treetrnk / rollem-telegram-bot

🎲 An RPG dice rolling bot for Telegram.

Home Page:https://telegram.me/rollembot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Highest/Lowest mixed with addition

eu7getafe opened this issue · comments

Hi!
Congrats for the bot. It's very usefull.

I've seen that comands like:
/r 1d20 + 3d6h + 3

are giving this kind of answer:
rolled + 3d6h + 3:
(3) =
3

Or:
rolled + 3d6h + 3:
(14) =
14

Seems that everything before or after the Highest/Lowest command is ignored. Is it a known error?

Thanks for the bug report. This actually isn't an issue with the bot though. You have the syntax wrong. The bot doesn't accept any spaces within the equation. So /r 1d20 + 3d6h + 3 should be written as /r 1d20+3d6h+3. I tried it with the spaces removed and it worked for me.

The reason for this is that the bot separates the command by spaces. Before the first space is the command, before the second space is the equation, and anything after the second space is considered a comment. So in your example, the bot actually rolled 1d20 and then treated + 3d6h + 3 as a comment. It was just coincidence that the d20 landed on a 3. Hope that helps!