【发布时间】:2018-06-03 19:03:05
【问题描述】:
如何添加一个代码来跟踪来自所有服务器的所有命令的总计数 bot 已安装。下面的命令示例我需要计算该命令在所有服务器和所有用户中使用了多少次。
@bot.command(pass_context=True)
async def first(ctx):
await bot.say("Hello {}".format(ctx.message.author.mention))
.
final result this Command has been used xx times from users all servers.
【问题讨论】:
-
显然你只是将 1 加到某个存储的某个数字上。所以真正的问题是“我可以在哪里存储来自不和谐机器人的信息?”:stackoverflow.com/questions/45242689/…
-
好的,我需要添加
bot.counter += 1和您的链接我需要在机器人或my_database.db文件中添加该代码吗? -
这是python代码。
标签: python-3.x discord.py