Browse Source

More goroutines?

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

2
main.go

@ -162,6 +162,7 @@ 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 {
go func(channel string, s *discordgo.Session) {
messages, _ := s.ChannelMessages(channel, 100, "", "", "") messages, _ := s.ChannelMessages(channel, 100, "", "", "")
for _, message := range messages { for _, message := range messages {
_, err := s.GuildMember(config.GuildID, message.Author.ID) _, err := s.GuildMember(config.GuildID, message.Author.ID)
@ -169,6 +170,7 @@ func cleanSocials(s *discordgo.Session) {
s.ChannelMessageDelete(channel, message.ID) s.ChannelMessageDelete(channel, message.ID)
} }
} }
}(channel, s)
} }
} }

Loading…
Cancel
Save