KazWolfe / HuskyBot

Discord chatbot for /r/DIY_Tech. Roo!
Mozilla Public License 2.0
6 stars 7 forks source link

Reactions seem to crash bot, affecting rpromote plugin #6

Closed dziban303 closed 4 years ago

dziban303 commented 4 years ago

After adding a new role, I tried running rpromote add which crashed the bot after it adding the emote to the specified message. After the bot rebooted, clicking on any of the reactions—not just the one created immediately before—causes the bot to crash without assigning or unassigning the role. Removing the reaction with rpromote remove crashes the bot as well, after it removes the emote. It seems like the problem may be with reactions in general, since running /debug react causes the bot to crash after it adds a reaction to any given message.

/admin logs doesn't record a reason for the crash.

KazWolfe commented 4 years ago

Fixed as of commit e71c501. This was caused by a bug in the underlying discord.py library that was resolved in version 1.2.5.

Further logs from another affected instance:

huskybot_1  | Traceback (most recent call last):
huskybot_1  |   File "HuskyBot.py", line 536, in <module>
huskybot_1  |     bot.entrypoint()
huskybot_1  |   File "HuskyBot.py", line 111, in entrypoint
huskybot_1  |     self.run(os.getenv('DISCORD_TOKEN', self.config.get('apiKey')))
huskybot_1  |   File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 598, in run
huskybot_1  |     return future.result()
huskybot_1  |   File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 579, in runner
huskybot_1  |     await self.start(*args, **kwargs)
huskybot_1  |   File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 543, in start
huskybot_1  |     await self.connect(reconnect=reconnect)
huskybot_1  |   File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 457, in connect
huskybot_1  |     await self._connect()
huskybot_1  |   File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 421, in _connect
huskybot_1  |     await self.ws.poll_event()
huskybot_1  |   File "/usr/local/lib/python3.6/site-packages/discord/gateway.py", line 469, in poll_event
huskybot_1  |     await self.received_message(msg)
huskybot_1  |   File "/usr/local/lib/python3.6/site-packages/discord/gateway.py", line 423, in received_message
huskybot_1  |     func(data)
huskybot_1  |   File "/usr/local/lib/python3.6/site-packages/discord/state.py", line 409, in parse_message_reaction_add
huskybot_1  |     emoji = PartialEmoji.with_state(self, animated=emoji_data['animated'], id=emoji_id, name=emoji_data['name'])
huskybot_1  | KeyError: 'animated'