编辑:我终于让代码工作了,但只针对一个频道。有没有办法让它成为两个频道?尝试过“或”,但不起作用。它只接受一个频道,有时甚至忽略所有频道
一般情况下删除所有用户消息并测试,但不包括!问吧!总的来说是一个问题!测试中的测试
@commands.Cog.listener()
async def on_message(self, message):
if not message.guild:
return
if not message.channel.name == 'general':
return
if message.channel.name == 'general' and message.content != '!ask' or '!question':
if message.author.bot:
pass
else:
await message.delete()
您可以通过浏览every commands来检查message author is a bot(对命令的响应)或消息是否包含command name:
要使其在特定频道上工作,您有多种选择:
json文件 您的python代码
相关问题 更多 >
编程相关推荐