Add social channel cleanup on member leave, but don't delete yet. Testing first!
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -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
|
||||
|
||||
20
main.go
20
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)
|
||||
|
||||
Reference in New Issue
Block a user