|
|
|
@ -165,6 +165,8 @@ func ready(s *discordgo.Session, event *discordgo.Ready) {
@@ -165,6 +165,8 @@ func ready(s *discordgo.Session, event *discordgo.Ready) {
|
|
|
|
|
|
|
|
|
|
func guildMemberUpdate(s *discordgo.Session, m *discordgo.GuildMemberUpdate) { |
|
|
|
|
defer log.PanicSafe() |
|
|
|
|
log.LogInfo("Calling guildMemberUpdate") |
|
|
|
|
defer log.LogInfo("returning from guildMemberUpdate") |
|
|
|
|
for role := range m.Roles { |
|
|
|
|
if fmt.Sprintf("%+v", role) == config.MonitorRole { |
|
|
|
|
s.ChannelMessageSend(config.AdminChannel, "New unverified user detected.") |
|
|
|
@ -178,6 +180,8 @@ func guildMemberUpdate(s *discordgo.Session, m *discordgo.GuildMemberUpdate) {
@@ -178,6 +180,8 @@ func guildMemberUpdate(s *discordgo.Session, m *discordgo.GuildMemberUpdate) {
|
|
|
|
|
|
|
|
|
|
func guildMemberAdd(s *discordgo.Session, m *discordgo.GuildMemberAdd) { |
|
|
|
|
defer log.PanicSafe() |
|
|
|
|
log.LogInfo("calling guildMemberAdd") |
|
|
|
|
defer log.LogInfo("Returning from guildMemberAdd") |
|
|
|
|
config.Unverified[m.User.ID] = time.Now() |
|
|
|
|
config.Probations[m.User.ID] = time.Now() |
|
|
|
|
s.GuildMemberRoleAdd(config.GuildID, m.User.ID, config.MonitorRole) |
|
|
|
@ -197,6 +201,8 @@ func guildMemberBanned(s *discordgo.Session, m *discordgo.GuildBanAdd) {
@@ -197,6 +201,8 @@ func guildMemberBanned(s *discordgo.Session, m *discordgo.GuildBanAdd) {
|
|
|
|
|
|
|
|
|
|
func guildMemberRemove(s *discordgo.Session, m *discordgo.GuildMemberRemove) { |
|
|
|
|
defer log.PanicSafe() |
|
|
|
|
log.LogInfo("Calling guildMemberRemove") |
|
|
|
|
defer log.LogInfo("returning from guildMemberRemove") |
|
|
|
|
go runPurge(s) |
|
|
|
|
banned := false |
|
|
|
|
for uid, join := range config.Probations { |
|
|
|
|