我有一个modmail僵尸程序(带有一些轻量级的命令),对我来说一切正常,除了我添加on_message事件
我已经尝试了所有可能的方法(包括await client.process_commands(message)
),但没有任何效果
我有on_ready和on_message
async def on_ready():
print (' ================================================')
print (' Bot is now online!')
print ('')
print (' Logged in as:')
print (' {0.user}'.format(client))
print ('')
print (' Working on:')
print (f' {len(client.guilds)} servers!')
print (' ================================================')
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="My DM's | DM for help!"))
@client.event
async def on_message(message):
if message.author !=client.user and isinstance(message.channel, discord.DMChannel):
log_channel=client.get_channel(0000000000000)
await log_channel.send(f"ID: {message.author.id} - "
+ f"**{message.author.name}#{message.author.discriminator}:**"
+ f"```{message.content}```")
await client.process_commands(message)
我可能做错了什么,但是如果我删除了on_message
可以正常工作,但是如果我没有,那我将无法回答modmail
(我有log_channel=client.get_channel(0000000000000)
的地方有频道ID,只是不在这里显示)