简体   繁体   中英

Discord Bot {Help}

I am sorry but there is no code attached to this, as I simply don't know what direction to go in. I have a bot made for a clan in Anigame. Quite simply there are weekly donations,(in this case it's 30k). For someone to donate, they can do.cl donate [number]. Ex: .cl donate 30000 | This donates 30k to your clan which is the weekly donation required and means you have donated for the week. Tracking donations is a pain in the ass so I wanted to make a bot to do it for me. What I wanted to do is make it so that this person that just donated 30k can do.info and it says something like this: Weekly: Done: Debt. N/A The debt being for people that have missed a week's donation: EX, Someone hasn't donated for 2 weeks. has 60k debt, This is the third week, and if they decide to donate 90k that week. the bot makes it so weekly donation is paid and debt is paid, I also don't know how to make that become possible. and I hope you [reader] understand where I'm trying to go with this, I have the base cron job code to make sure it resets weekly; I just don't know how to do the code) Tldr. How to make it so that.cl donate (number) updates a Weekly Number under the command [.info]. I wouldn't normally be so specific so I can learn how but I don't know the commands associated with doing this kind of thing. Thanks~

You should start with researching databases (for example SQLite), and then coding your bot to input values to that database on each command, then calculate the.info command based on the values that specific user has in the database, then your cron job could reset the database weekly (or the bot could do that too, you do you). Here's a good tutorial:SQLite tutorial

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM