From 322a88e0ad7bd24ef17d41a6584afd80b26a30fa Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Mon, 22 Aug 2022 07:59:39 -0500 Subject: [PATCH] Make reaction handler more shit-posty --- cmd/bb/main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/bb/main.go b/cmd/bb/main.go index f436507..e600f72 100644 --- a/cmd/bb/main.go +++ b/cmd/bb/main.go @@ -147,14 +147,18 @@ func reactionHandler(s *discordgo.Session, m *discordgo.MessageCreate) { for _, a := range m.Attachments { if strings.HasPrefix(a.ContentType, "image/") { - r := emojis[rand.Intn(len(emojis))] - s.MessageReactionAdd(m.ChannelID, m.ID, r) + for i := 0; i < command.RandInt(1, len(emojis)); i++ { + r := emojis[rand.Intn(len(emojis))] + s.MessageReactionAdd(m.ChannelID, m.ID, r) + } } } for range m.Embeds { - r := emojis[rand.Intn(len(emojis))] - s.MessageReactionAdd(m.ChannelID, m.ID, r) + for i := 0; i < command.RandInt(1, len(emojis)); i++ { + r := emojis[rand.Intn(len(emojis))] + s.MessageReactionAdd(m.ChannelID, m.ID, r) + } } }