1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Move /roll to strings

This commit is contained in:
Steffo 2019-02-10 14:40:20 +01:00
parent 944371b32d
commit c9069a5221
2 changed files with 10 additions and 2 deletions

View file

@ -126,6 +126,14 @@ class MATCHMAKING:
MATCH_CLOSED = "⚠ Il matchmaking per questa partita è terminato!"
# Dice roller
class ROLL:
SUCCESS = "🎲 {result}"
class ERRORS:
INVALID_SYNTAX = "⚠ Il tiro dei dadi è fallito. Controlla la sintassi!"
# Ship creator
class SHIP:
RESULT = "💕 {one} + {two} = <b>{result}</b>"

View file

@ -698,9 +698,9 @@ def cmd_roll(bot: telegram.Bot, update: telegram.Update):
try:
result = dice.roll(f"{dice_string}t")
except dice.DiceBaseException:
bot.send_message(update.message.chat.id, "⚠ Il tiro dei dadi è fallito. Controlla la sintassi!")
reply(bot, update, strings.ROLL.ERRORS.INVALID_SYNTAX)
return
bot.send_message(update.message.chat.id, f"🎲 {result}")
reply(bot, update, strings.ROLL.SUCCESS, result=result)
@command