From e316246944c353eddeb0b8be0fa92a6cdda64cc4 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Thu, 29 Oct 2020 11:59:30 -0400 Subject: [PATCH] Add guildMemberUpdate for when monitorRole is added --- main.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 279ffcf..bf3da11 100644 --- a/main.go +++ b/main.go @@ -163,12 +163,17 @@ func ready(s *discordgo.Session, event *discordgo.Ready) { s.UpdateStatus(0, "DreamDaddy v0.9") } -//func guildMemberRoleAdd(s *discordgo.Session, m *discordgo.GuildMemberRoleAdd) { -// defer log.PanicSafe() -// config.Unverified[m.User.ID] = time.Now() -// config.Probations[m.User.ID] = time.Now() -// saveConfig() -//} +func guildMemberUpdate(s *discordgo.Session, m *discordgo.GuildMemberUpdate) { + defer log.PanicSafe() + for role := range m.Roles { + if fmt.Sprintf("%+v", role) == config.MonitorRole { + config.Unverified[m.User.ID] = time.Now() + config.Probations[m.User.ID] = time.Now() + saveConfig() + } + } + +} func guildMemberAdd(s *discordgo.Session, m *discordgo.GuildMemberAdd) { defer log.PanicSafe()