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))
|
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")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue