v5.0.0.alpha.21 Why the audio event change ? #2277
Replies: 2 comments 1 reply
-
This provides less confusion as it's a single source of truth without ambiguity. The old events caused a lot of questions, asking why one of them didn't work, because it was using the move event instead. This was a very common issue and thus had to be resolved.
They are quite literally the same event in the Discord API. It is simply an update to the if (event.getChannelLeft() == null) {
... join code ...
} else if (event.getChannelJoined() == null) {
... left code ...
} else {
... move code ...
} |
Beta Was this translation helpful? Give feedback.
-
I think this is a solid change. It actually does simplify things since fundamentally you want to handle a change in the audio state, and need only be concerned with a single event. The only improvement could be wrapping the null/not null logic around an enum, so you could have like event.getVoiceUpdateType()
if(event.getVoiceUpdateType() == VoiceUpdateType.MOVE)
// logic This would really only serve to write more vebose code though, arguably an improvement for legibility but not needed otherwise. |
Beta Was this translation helpful? Give feedback.
-
I don't really understand the point of the change concerning the audio channel events change.
This just provides more confusion : they are different events happening and must not be treated as the same in code.
Beta Was this translation helpful? Give feedback.
All reactions