Skip to content

Commit

Permalink
Roll critical success
Browse files Browse the repository at this point in the history
  • Loading branch information
nfaltermeier committed Sep 4, 2023
1 parent 0571672 commit 3bcc608
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/roll.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@

async def on_message(message):
if message.content.startswith('$roll'):
await message.channel.send(f'{message.author.mention} rolled {random.randint(0, 100)}')
result = random.randint(0, 100)
comment = ''
if result == 0:
comment = " Critial failure!"
elif result == 100:
comment = " Critial success!"
await message.channel.send(f'{message.author.mention} rolled {result}.{comment}')
return True
else:
return False

0 comments on commit 3bcc608

Please sign in to comment.