always update guild on getVoiceChannelID
Marco Andronaco andronacomarco@gmail.com
Tue, 01 Oct 2024 17:47:48 +0200
2 files changed,
9 insertions(+),
1 deletions(-)
M
src/shoot.go
→
src/shoot.go
@@ -72,6 +72,7 @@
killerID := m.Author.ID var allMembers []string for _, vs := range guild.VoiceStates { + logger.Debug(vs.UserID) if vs.ChannelID == voiceChannelID && vs.UserID != killerID { member, err := s.State.Member(guild.ID, vs.UserID) if err != nil {
M
src/utils.go
→
src/utils.go
@@ -13,7 +13,14 @@ response = "Please, use this inside a server."
return } - g, err := s.State.Guild(m.GuildID) + _, err := s.Guild(m.GuildID) + if err != nil { + logger.Errorf("could not update guild: %s", err) + response = msgError + return + } + + g, err = s.State.Guild(m.GuildID) if err != nil { logger.Errorf("could not get guild: %s", err) response = msgError