【问题标题】:Discord.py bot resending messages to another channel breaking when reaction addedDiscord.py bot 在添加反应时将消息重新发送到另一个频道中断
【发布时间】:2020-04-13 19:33:59
【问题描述】:

我有一个机器人来接收在一个频道中发送的所有消息,然后在另一个频道中重新发送它们。 代码如下:

@client.event
async def on_message(message): 
    channel = message.channel
    content = message.content
    author = message.author.name
    if channel.id == channelid1
        channel.id = channelid2
        await channel.send(author + ": " + content)
        channel.id = channelid1

它工作正常,但是一旦将反应添加到任何消息中,机器人就会中断并给出以下错误消息:

  File "C:\Users\nij\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\state.py", 
line 407, in parse_message_reaction_add
    emoji = PartialEmoji.with_state(self, animated=emoji_data['animated'], id=emoji_id, 
name=emoji_data['name'])
KeyError: 'animated'

有谁知道如何解决这个问题?如果没有,是否有人知道使机器人自动重新连接的方法?

谢谢!

【问题讨论】:

    标签: python discord discord.py


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-24
      • 2022-01-21
      • 2020-10-27
      • 1970-01-01
      • 2021-07-31
      • 2018-11-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多