Compare commits
2 Commits
f8cf68af83
...
322a88e0ad
Author | SHA1 | Date | |
---|---|---|---|
322a88e0ad | |||
0fd921ee28 |
@ -63,7 +63,7 @@ func main() {
|
|||||||
viper.AddConfigPath(".")
|
viper.AddConfigPath(".")
|
||||||
err = viper.ReadInConfig()
|
err = viper.ReadInConfig()
|
||||||
|
|
||||||
if err != nil {
|
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
|
||||||
log.Fatalf("fatal error config file: %v", err)
|
log.Fatalf("fatal error config file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,15 +147,19 @@ 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++ {
|
||||||
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for range m.Embeds {
|
for range m.Embeds {
|
||||||
|
for i := 0; 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)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user