result display
This commit is contained in:
parent
431a86b74d
commit
c5d950ca07
10
bot.py
10
bot.py
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue