1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-11 09:32:50 +00:00

fix: channel join sound bug

This commit is contained in:
2022-03-23 22:13:28 -05:00
parent 6b8db59e98
commit 149ba48802
7 changed files with 64 additions and 74 deletions

View File

@@ -57,7 +57,8 @@ func VoiceStateHandler(s *discordgo.Session, v *discordgo.VoiceStateUpdate) {
voiceConnection := conn.getVoiceConnection()
if voiceConnection != nil && voiceConnection.Ready && voiceConnection.ChannelID == v.VoiceState.ChannelID {
if voiceConnection != nil && voiceConnection.Ready && voiceConnection.ChannelID == v.VoiceState.ChannelID &&
(v.BeforeUpdate == nil || v.BeforeUpdate.ChannelID != voiceConnection.ChannelID) {
user, err := model.UserGet(db.GetConn(), v.VoiceState.UserID)