Skip to content

Commit

Permalink
Fix dice recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelemusiani committed Aug 13, 2023
1 parent 1743ed8 commit cd89c9a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,10 @@ func executeCommandWithName(bot *tgbotapi.BotAPI, update *tgbotapi.Update, comma
}

func filterMessage(bot *tgbotapi.BotAPI, message *tgbotapi.Message) bool {
var dices = []string{"🎲", "🎯", "🏀", "⚽", "🎳", "🎰"}

receivedText := strings.ToLower(message.Text)
if idx := slices.Index(dices, receivedText); idx != -1 {
msg := tgbotapi.NewMessage(message.Chat.ID, "found a dice")
bot.Send(msg)
if message.Dice != nil {
// msg := tgbotapi.NewMessage(message.Chat.ID, "Found a dice")
// bot.Send(msg)
return true
}

return false
}

0 comments on commit cd89c9a

Please sign in to comment.