state: Fix voice state removal condition

This commit addresses issue #220.
This commit is contained in:
diamondburned 2021-06-08 02:53:54 -07:00
parent 7785887719
commit 1a77edb1b1
1 changed files with 1 additions and 1 deletions

View File

@ -327,7 +327,7 @@ func (s *State) onEvent(iface interface{}) {
case *gateway.VoiceStateUpdateEvent:
vs := &ev.VoiceState
if vs.ChannelID == 0 {
if !vs.ChannelID.IsValid() {
if err := s.Cabinet.VoiceStateRemove(vs.GuildID, vs.UserID); err != nil {
s.stateErr(err, "failed to remove voice state from state")
}