Skip to content

Commit

Permalink
Fix bug with returning when user is bot
Browse files Browse the repository at this point in the history
  • Loading branch information
chilipizdrick committed Apr 5, 2024
1 parent bacadb9 commit ae75842
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utils/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package utils
import (
"errors"
"log"
"os"

discord "github.com/bwmarrin/discordgo"
)
Expand Down Expand Up @@ -59,7 +58,8 @@ func GenericVoiceCommandHandler(filepath string) func(s *discord.Session, i *dis
})
defer s.InteractionResponseDelete(i.Interaction)

if vs, _ := s.State.VoiceState(i.GuildID, os.Getenv("CLIENT_ID")); vs.ChannelID != "" {
// Return if user is bot
if i.Member.User.Bot {
return
}

Expand Down Expand Up @@ -95,7 +95,8 @@ func GenericRandomVoiceCommandHandler(dirpath string) func(s *discord.Session, i
})
defer s.InteractionResponseDelete(i.Interaction)

if vs, _ := s.State.VoiceState(i.GuildID, os.Getenv("CLIENT_ID")); vs.ChannelID != "" {
// Return if user is bot
if i.Member.User.Bot {
return
}

Expand Down

0 comments on commit ae75842

Please sign in to comment.