diff --git a/discordEvents.go b/discordEvents.go index 0942036..32a8633 100644 --- a/discordEvents.go +++ b/discordEvents.go @@ -106,7 +106,7 @@ func readReaction(s *discordgo.Session, m *discordgo.MessageReactionAdd) { log.LogInfo("%+v has requested ASL for user %+v.", admin.User.Username, user.Username) return } else if m.Emoji.Name == "⛔" { - s.GuildBanCreateWithReason(config.GuildID, user.ID, fmt.Sprintf("Underage or too many failed verifications. %+v", admin.User.Username), 5) + s.GuildBanCreateWithReason(config.GuildID, user.ID, fmt.Sprintf("Underage female or too many failed verifications. %+v", admin.User.Username), 5) verification.Status = "Banned" } else { return diff --git a/main.go b/main.go index cdd08cd..17a006a 100644 --- a/main.go +++ b/main.go @@ -151,10 +151,28 @@ func runPurge(s *discordgo.Session) { s.ChannelMessageDelete(config.MonitorChann, message.ID) } } - + go cleanSocials(s) saveConfig() } +func cleanSocials(s *discordgo.Session) { + if len(config.SocialChanns) == 0 { + config.SocialChanns = append(config.SocialChanns, "730437117913858129") + config.SocialChanns = append(config.SocialChanns, "730439200771670076") + config.SocialChanns = append(config.SocialChanns, "730439324675473470") + } + for _, channel := range config.SocialChanns { + messages, _ := s.ChannelMessages(channel, 100, "", "", "") + for _, message := range messages { + _, err := s.GuildMember(config.GuildID, message.Author.ID) + if err != nil { + //s.ChannelMessageDelete(channel, message.ID) + s.ChannelMessageSend(config.AdminChannel, fmt.Sprintf("Suggested delete: %+v from <#%+v>, reason: Member not found.", message.ID, channel)) + } + } + } +} + func verifyMember(s *discordgo.Session, u discordgo.User) { defer log.PanicSafe() s.GuildMemberRoleAdd(config.GuildID, u.ID, config.VerifiedRole) diff --git a/types.go b/types.go index 617cee3..95d911e 100644 --- a/types.go +++ b/types.go @@ -32,6 +32,7 @@ type Config struct { MonitorRole string IntroChann string MonitorChann string + SocialChanns []string VerifiedRole string BumpTime time.Time LastBumper string