diff --git a/main.go b/main.go index dd81601..24580ca 100644 --- a/main.go +++ b/main.go @@ -162,13 +162,15 @@ func cleanSocials(s *discordgo.Session) { 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) + go func(channel string, s *discordgo.Session) { + 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) + } } - } + }(channel, s) } }