[英](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.