简体   繁体   English

Discord 机器人 {帮助}

[英]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.很抱歉,这里没有附加代码,因为我根本不知道 go 的方向。我在 Animgame 中有一个为部落制作的机器人。 Quite simply there are weekly donations,(in this case it's 30k).很简单,每周都有捐款(在这种情况下是 30k)。 For someone to donate, they can do.cl donate [number].对于有人捐赠,他们可以做.cl donate [number]。 Ex: .cl donate 30000 |例如:.cl 捐赠 30000 | This donates 30k to your clan which is the weekly donation required and means you have donated for the week.这将向您的氏族捐赠 30k,这是每周所需的捐赠,意味着您已经捐赠了一周。 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.我想做的是让这个刚刚捐赠 30k 的人可以做 do.info,上面写着这样的内容:每周:完成:债务。 N/A The debt being for people that have missed a week's donation: EX, Someone hasn't donated for 2 weeks. N/A 对于错过一周捐赠的人的债务:EX,有人两周没有捐赠。 has 60k debt, This is the third week, and if they decide to donate 90k that week.有 60k 的债务,这是第三周,如果他们决定在那周捐赠 90k。 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;我希望你 [读者] 明白我在哪里尝试 go,我有基本的 cron 作业代码来确保它每周重置; I just don't know how to do the code) Tldr.我只是不知道如何编写代码)Tldr。 How to make it so that.cl donate (number) updates a Weekly Number under the command [.info].如何使.cl donate (number) 在命令 [.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).您应该从研究数据库(例如 SQLite)开始,然后对您的机器人进行编码以在每个命令上向该数据库输入值,然后根据特定用户在数据库中的值计算 .info 命令,然后您的 cron 作业可以每周重置数据库(或者机器人也可以这样做,你可以)。 Here's a good tutorial:SQLite tutorial这里有一个很好的教程:SQLite 教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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