Reaction handler will not add a variable number of reactions

This commit is contained in:
Ryan Cavicchioni 2022-08-22 19:30:56 -05:00
parent d75a02554d
commit cf3fece52c
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

View File

@ -141,7 +141,7 @@ func reactionHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
for _, a := range m.Attachments { for _, a := range m.Attachments {
if strings.HasPrefix(a.ContentType, "image/") { if strings.HasPrefix(a.ContentType, "image/") {
for i := 0; i < command.RandInt(1, len(emojis)); i++ { for i := 1; i <= command.RandInt(1, len(emojis)); i++ {
r := emojis[rand.Intn(len(emojis))] r := emojis[rand.Intn(len(emojis))]
s.MessageReactionAdd(m.ChannelID, m.ID, r) s.MessageReactionAdd(m.ChannelID, m.ID, r)
} }
@ -149,7 +149,7 @@ func reactionHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
} }
for range m.Embeds { for range m.Embeds {
for i := 0; i < command.RandInt(1, len(emojis)); i++ { for i := 1; i <= command.RandInt(1, len(emojis)); i++ {
r := emojis[rand.Intn(len(emojis))] r := emojis[rand.Intn(len(emojis))]
s.MessageReactionAdd(m.ChannelID, m.ID, r) s.MessageReactionAdd(m.ChannelID, m.ID, r)
} }