From 5f60c2eb17a8a271302ed18304c626424c9c55d2 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 11 Sep 2018 02:11:56 +0200 Subject: [PATCH] This doesn't either --- requirements.txt | 3 ++- telegrambot.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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}")