2 回答
TA贡献1816条经验 获得超4个赞
这可以使用on_message
@bot.event
async def on_message(m):
if m.channel.id == ChannelIDOfSupport Channel:
if m.content.replace(bot.prefix, "") not in [i.name for i in bot.commands]:
await m.delete()
TA贡献1847条经验 获得超11个赞
所以基本上我所做的是替换消息侦听器的实际命令,如果它以支持执行命令开始,那么我恢复了命令功能。它看起来像这样:
async def on_message(m):
if m.channel.id == 735866701069025301:
if m.content.startswith('=ticket'):
await m.author.send('Your ticket will be created according to what you choose, use the = before choosing a number and then put the number next to it (Example: =2) \n \n **1. General Support** \n \n **2. Staff Application**')
await m.channel.purge()
else: {
await m.delete()
}
await client.process_commands(m)
添加回答
举报