only care about joins, not mutes/deafens
This commit is contained in:
parent
f1f59116b5
commit
8257bf55ab
12
handlers.go
12
handlers.go
@ -139,6 +139,18 @@ func guildCreate(s *discordgo.Session, event *discordgo.GuildCreate) {
|
|||||||
func voiceUpdate(s *discordgo.Session, event *discordgo.VoiceStateUpdate) {
|
func voiceUpdate(s *discordgo.Session, event *discordgo.VoiceStateUpdate) {
|
||||||
if event.GuildID == BridgeConf.GID {
|
if event.GuildID == BridgeConf.GID {
|
||||||
if event.ChannelID == BridgeConf.CID {
|
if event.ChannelID == BridgeConf.CID {
|
||||||
|
//check to see if this is actually a new user
|
||||||
|
g, err := s.State.Guild(event.GuildID)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Could not find guild while checking VoiceStateUpdate")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for _, vs := range g.VoiceStates {
|
||||||
|
if vs.UserID == event.UserID {
|
||||||
|
//user is already in channel (and is probably just muting/etc), ignore
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
log.Println("user joined watched discord channel")
|
log.Println("user joined watched discord channel")
|
||||||
u, err := s.User(event.UserID)
|
u, err := s.User(event.UserID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user