Browse Source

More goroutines?

master
Gregory Rudolph 4 years ago
parent
commit
d85da5989a
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 14
      main.go

14
main.go

@ -162,13 +162,15 @@ func cleanSocials(s *discordgo.Session) {
config.SocialChanns = append(config.SocialChanns, "730439324675473470") config.SocialChanns = append(config.SocialChanns, "730439324675473470")
} }
for _, channel := range config.SocialChanns { for _, channel := range config.SocialChanns {
messages, _ := s.ChannelMessages(channel, 100, "", "", "") go func(channel string, s *discordgo.Session) {
for _, message := range messages { messages, _ := s.ChannelMessages(channel, 100, "", "", "")
_, err := s.GuildMember(config.GuildID, message.Author.ID) for _, message := range messages {
if err != nil { _, err := s.GuildMember(config.GuildID, message.Author.ID)
s.ChannelMessageDelete(channel, message.ID) if err != nil {
s.ChannelMessageDelete(channel, message.ID)
}
} }
} }(channel, s)
} }
} }

Loading…
Cancel
Save