这可以使用on_message@bot.eventasync 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()
所以基本上我所做的是替换消息侦听器的实际命令,如果它以支持执行命令开始,那么我恢复了命令功能。它看起来像这样: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)