all repos — disgord @ cf72b4a9d665c121e9dbb5fad81e35dc068423d2

A simple Discord bot in Go.

always update guild on getVoiceChannelID
Marco Andronaco andronacomarco@gmail.com
Tue, 01 Oct 2024 17:47:48 +0200
commit

cf72b4a9d665c121e9dbb5fad81e35dc068423d2

parent

2d217f4b2580d9476ffdac02449fe8a4b6da212e

2 files changed, 9 insertions(+), 1 deletions(-)

jump to
M src/shoot.gosrc/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.gosrc/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