diff --git a/requirements.txt b/requirements.txt index e61bde71..84d87835 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,4 +12,5 @@ bcrypt markdown2 pygments markovify -praw \ No newline at end of file +praw +dice \ No newline at end of file diff --git a/telegrambot.py b/telegrambot.py index d0ae4c5a..44e8783f 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -506,10 +506,14 @@ def cmd_markov(bot: Bot, update: Update): def cmd_roll(bot: Bot, update: Update): dice_string = update.message.text.split(" ", 1)[1] try: - result = dice.utilities.verbose_print(dice_string) + result = dice.roll(dice_string) except dice.DiceBaseException: bot.send_message(update.message.chat.id, "⚠ Il tiro dei dadi è fallito. Controlla la sintassi!") return + if isinstance(result, list): + result = "\n".join([str(r) for r in result]) + elif isinstance(result, int): + result = str(result) bot.send_message(update.message.chat.id, f"🎲 {result}")