[英]My discord bot is responding to commands in dms(Python)
So basically I have been working on a discord bot for about two weeks now and someone brought it to my attention that you can activate commands in dms, I don't want people to do that since it allows people with lower roles to ruin other servers, any solutions?所以基本上我已经在一个不和谐的机器人上工作了大约两个星期,有人让我注意到你可以在 dms 中激活命令,我不希望人们这样做,因为它允许较低角色的人破坏其他服务器,有什么解决办法吗? Thank you in advanced(This is the first time I ask a question here so I'm not familiar with the format)先谢谢你(这是我第一次在这里提问,所以我不熟悉格式)
You can add another decorator to the commands funtion to set it guild only您可以向命令功能添加另一个装饰器以将其设置为仅公会
Docs: commands.guild_only()
文档: commands.guild_only()
@commands.command()
@commands.guild_only()
async def cmd(ctx):
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.