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)) dice.append(Dice(arg))
try: 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: except DiceTextError as e:
print(e) print(e)
await ctx.send(str(e)) await ctx.send(str(e))
return return
msg = ",".join(results) await ctx.send("\n".join(text))
print(msg)
await ctx.send(msg)
token = environ.get("DISCORD_TOKEN") token = environ.get("DISCORD_TOKEN")