python - How to add mathematical operations with dice rolls to my Discord bot? - Stack Overflow

admin2025-05-01  0

I’m building a Discord bot using Python and discord.extmands. My bot already supports basic dice rolls using commands like !r 1d20 or !r 2d6. Now, I want to expand its functionality to allow mathematical operations with multiple dice rolls and modifiers in a single command.

Example of what I want:

Input: !r 1d20 + 1d6 + 2d6 + 10

Output:

转载请注明原文地址:http://anycun.com/QandA/1746098853a91649.html