Fix an issue where regex reactions would happen even if the regex doesn't match
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
53ecef743c
commit
3cc0003d65
|
@ -105,11 +105,9 @@ func reactionsListCmd(s *discordgo.Session, i *discordgo.InteractionCreate) erro
|
|||
return err
|
||||
}
|
||||
|
||||
fmt.Println(reactions)
|
||||
var sb strings.Builder
|
||||
sb.WriteString("**Reactions:**\n")
|
||||
for _, reaction := range reactions {
|
||||
fmt.Println(reaction.Reaction)
|
||||
sb.WriteString("- _[")
|
||||
if reaction.Chance < 100 {
|
||||
sb.WriteString(strconv.Itoa(reaction.Chance))
|
||||
|
|
|
@ -51,7 +51,7 @@ func onMessage(s *discordgo.Session, mc *discordgo.MessageCreate) {
|
|||
continue
|
||||
}
|
||||
|
||||
content := reaction.Reaction
|
||||
var content db.StringSlice
|
||||
switch reaction.ReactionType {
|
||||
case db.ReactionTypeText:
|
||||
submatch := re.FindSubmatch([]byte(mc.Content))
|
||||
|
@ -72,7 +72,7 @@ func onMessage(s *discordgo.Session, mc *discordgo.MessageCreate) {
|
|||
}
|
||||
}
|
||||
|
||||
if content[0] != "" {
|
||||
if content != nil {
|
||||
err = performReaction(s, reaction, content, mc)
|
||||
if err != nil {
|
||||
log.Error("Error performing reaction").Err(err).Send()
|
||||
|
|
Loading…
Reference in New Issue