Discord.py-on_message使我的命令停止工作

时间:2019-06-09 09:44:16

标签: python-3.x discord.py discord.py-rewrite

我有一个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,只是不在这里显示)

0 个答案:

没有答案
相关问题