result display

This commit is contained in:
Andrei Stoica 2025-01-16 13:19:52 -05:00
parent 431a86b74d
commit c5d950ca07
1 changed files with 6 additions and 4 deletions

10
bot.py
View File

@ -25,15 +25,17 @@ async def roll(ctx: Context, *args: str):
dice.append(Dice(arg))
try:
results = ["(" + ",".join(d.roll()) + "," for d in dice]
text = []
for die in dice:
roll = die.roll()
text.append(f"{die.text} => {roll} = {sum(roll)}")
print(text)
except DiceTextError as e:
print(e)
await ctx.send(str(e))
return
msg = ",".join(results)
print(msg)
await ctx.send(msg)
await ctx.send("\n".join(text))
token = environ.get("DISCORD_TOKEN")