errbotio / err-backend-discord

Backend for Discord for Errbot
GNU General Public License v3.0
23 stars 22 forks source link

discord.py 1.6.0 breaks the bot #38

Closed pcn closed 3 years ago

pcn commented 3 years ago

Trying to install with the current version of discord.py, 1.6.0, the plugin can no longer properly populate the frm and username attributes of the errbot.backends.base.Message (I think). I'm guessing that 1.6.0 has changed or broken the interface to the discord.Message but I haven't looked at this closely yet. Going to open a PR that reverts the default change to 1.6.0 in the hopes that'll help.

My symptoms look like this when the logs are set to DEBUG:

2021-01-11 19:07:14,209 DEBUG    discord.gateway           For Shard ID None: WebSocket Event: {'t': 'MESSAGE_CREATE', 's': 4, 'op': 0, 'd': {'type': 0, 'tts': False, 'timestamp': '2021-01-11T19:07:14.179000+00:00', 'referenced_message': None, 'pinned': False, 'nonce': '798266790961479680', 'mentions': [], 'mention_roles': [], 'mention_everyone': False, 'id': '798266791524040714', 'flags': 0, 'embeds': [], 'edited_timestamp': None, 'content': 'help', 'channel_id': '798233770657316884', 'author': {'username': 'p_c_n', 'public_flags': 0, 'id': '685502622639063085', 'discriminator': '9541', 'avatar': '977b5cea54d52fb2870d80f5ef50f5fc'}, 'attachments': []}}
2021-01-11 19:07:14,209 DEBUG    discord.client            Dispatching event socket_response
2021-01-11 19:
07:14,210 DEBUG    discord.client            Dispatching event message
2021-01-11 19:07:14,211 DEBUG    errbot.core               *** frm = None
2021-01-11 19:07:14,212 DEBUG    errbot.core               *** username = None
2021-01-11 19:07:14,213 DEBUG    errbot.core               *** text = help

Downgrading to 1.5.1 fixes it.