简体   繁体   English

(discord.py)我怎样才能让我的机器人在当前命令完成之前不回复其他命令

[英](discord.py) How can I make it so my bot that doesn't reply to other commands until the current command is finished

I have a discord bot written in python.我有一个用 python 编写的 discord 机器人。 It doesn't do much, however if you spam commands while it is in the middle to replying to another command, it freaks out.它没有多大作用,但是如果您在回复另一个命令的中间发送垃圾命令,它就会吓坏了。 is there a way to make it refuse other commands until it has finished with the current process?有没有办法让它在完成当前进程之前拒绝其他命令?

Maybe some global variable "ready" and just allow to run commands if ready is true?也许一些全局变量“准备好”,如果准备就绪,只允许运行命令? At start of command set ready to false and at the end to true.在命令开始时设置为假,在结束时设置为真。

暂无
暂无

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

相关问题 如果我的 discord 机器人被 ping 通,我该如何回复它? (不和谐.py? - How can I make my discord bot reply if its been pinged? (discord.py? (discord.py) 如何让我的机器人随机回复 DM? - (discord.py) How can I make my bot randomly reply to DMs? 当我的机器人或其他机器人在命令中使用时,如何让我的机器人说些什么? (不和谐.py) - How can I make my bot say something when it or another bot is used in the command? (discord.py) discord.py - 我的服务器信息命令没有回复 - discord.py - my server info command doesn't reply 我怎样才能使我的 discord.py bot kick 命令可选原因部分成为必需的原因? - How can i make my discord.py bot kick command optional reason section to a required reason? 如何让我的 discord.py 机器人在 a.txt 文件中随机选择一行并回复消息 - How do i make my discord.py bot pick an random line in a .txt file and reply to a message 我无法使用 discord.py 向我的不和谐机器人添加命令 - I can't add commands to my discord bot with discord.py Discord.py如何使其不将url和参数转换为小写字母,而仅使其转换命令? - Discord.py How do i make it so this doesn't convert urls and arguments to lower case and only make it convert commands? 在 discord.py 我怎样才能让我的机器人命令只能在特定通道或特定服务器中使用? - in discord.py How can i make my bot that the commands only can be use in specific channel or specific server? Discord.py Bot - 如何根据 ping 进行机器人回复? - Discord.py Bot - How to make a bot reply depending on the ping?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM