Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

message_update events disappear in private channels that are not newly created #31

Open
brakhane opened this issue Jun 18, 2018 · 3 comments

Comments

@brakhane
Copy link
Contributor

brakhane commented Jun 18, 2018

This time, no PR, as I'm not yet sure what the correct way to handle it is.

handle_message_update in State crashes when a private message is updated, because make_message tries to check message.channel.type. However, message.channel can return None if the channel is a private channel that we haven't seen yet (because it was created before a restart of the Bot, for example)

I think message.channel should, if it can't find a channel in the cache, call the Discord channel/{id} endpoint to get the necessary information

This is a pretty serious bug, BTW, because once it occurs, the bot basically stops handling any events and has to be restarted

@Fuyukai
Copy link
Owner

Fuyukai commented Jun 18, 2018

message.channel is a property, so that wouldn't work (you'd have to channel = await message.channel).

I think the best way to handle this is to just go with the standard and exit from state parsing entirely, as is the standard case when dealing with cache inconsistently.

@Fuyukai Fuyukai reopened this Jun 19, 2018
@Fuyukai Fuyukai changed the title message_update crashes in a private channel that was created before bot restart message_update events disappear in private channels that are not newly created Jun 19, 2018
@brakhane
Copy link
Contributor Author

Reported as discord/discord-api-docs#615. According to discord/discord-api-docs#184 they try to work around that by issuing a CHANNEL_CREATE before sending a MESSAGE_CREATE, which works fine, but they forgot to also send when sending a MESSAGE_UPDATE.

Given my previous experience with Discord bugs, I wouldn't hold my breath until they fix it (if they ever do)

@brakhane
Copy link
Contributor Author

At least they fixed the documentation to state the private_channels will always be empty.

There are no plans to fire channel_create messages for anything other than message_create.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants