You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more of a question than an issue, but is there a way to figure out which event occurred first between two events?
My use-case is that I have a bot that sends join and leave messages into a text channel whenever someone joins or leaves an associated voice channel. I have a handler which reacts to VoiceStateUpdateEvts and sends the appropriate message. The issue is that sometimes someone joins and immediately leaves a voice channel (or vice-versa). When that occurs it can sometimes happen that the leave event is handled before the join event which means the messages are sent out of order.
So my question is whether there's a way to recover such ordering information. From the Discord API I see there's some sort of sequence number but I'm not sure whether that's suitable for this.
The text was updated successfully, but these errors were encountered:
We could definitely add something to the event handler context to include the sequence number, though I really wouldn't be surprised if discord is sending the events out of order to begin with. The only point of parallelism in event handling is each event handling running in its own thread, internal library event handling is sequential until that point.
This is more of a question than an issue, but is there a way to figure out which event occurred first between two events?
My use-case is that I have a bot that sends join and leave messages into a text channel whenever someone joins or leaves an associated voice channel. I have a handler which
react
s toVoiceStateUpdateEvt
s and sends the appropriate message. The issue is that sometimes someone joins and immediately leaves a voice channel (or vice-versa). When that occurs it can sometimes happen that the leave event is handled before the join event which means the messages are sent out of order.So my question is whether there's a way to recover such ordering information. From the Discord API I see there's some sort of sequence number but I'm not sure whether that's suitable for this.
The text was updated successfully, but these errors were encountered: