|
|
@ -151,10 +151,28 @@ func runPurge(s *discordgo.Session) { |
|
|
|
s.ChannelMessageDelete(config.MonitorChann, message.ID) |
|
|
|
s.ChannelMessageDelete(config.MonitorChann, message.ID) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
go cleanSocials(s) |
|
|
|
saveConfig() |
|
|
|
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) { |
|
|
|
func verifyMember(s *discordgo.Session, u discordgo.User) { |
|
|
|
defer log.PanicSafe() |
|
|
|
defer log.PanicSafe() |
|
|
|
s.GuildMemberRoleAdd(config.GuildID, u.ID, config.VerifiedRole) |
|
|
|
s.GuildMemberRoleAdd(config.GuildID, u.ID, config.VerifiedRole) |
|
|
|