我正在为我的discord机器人编程,我想在您向机器人发送DM时设置一个不同的命令集。我有一个DM
cog和一个CHANNELS
cog。在myevent.on_message
中,我的代码是:
if message.channel.id in _allowed_channels:
await bot.process_commands(message)
有没有办法做到这一点:
if message.guild == None: # Direct messages
await DM.process_commands(message)
else:
await CHANNELS.process_commands(message)
谢谢你的帮助
我知道了! discord.ext.commands有一个复选框:
您甚至可以使用cog_检查:
相关问题 更多 >
编程相关推荐