Skip to content

Commit

Permalink
fix: fixed custom message setting bot status
Browse files Browse the repository at this point in the history
  • Loading branch information
Millefeuille42 committed Apr 4, 2024
1 parent 136d4da commit ef78244
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/bot/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"fmt"
"github.com/bwmarrin/discordgo"
"log"
"strings"
)

var eventMap = map[redisEvent.EventType]func([]byte) error{
Expand Down Expand Up @@ -50,9 +51,11 @@ func handleNewMessage(event []byte) error {
}

newsTitle, _ := embeds.SplitNewsMessage(newMessage)
err = setBotStatus(newsTitle)
if err != nil {
log.Println(err)
if !strings.HasPrefix(newsTitle, "BOT: ") {
err = setBotStatus(newsTitle)
if err != nil {
log.Println(err)
}
}

return streamEmbed(embeds.BuildFeedEmbed(newMessage, 15616811))
Expand Down

0 comments on commit ef78244

Please sign in to comment.