mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-11 06:36:24 +02:00
Update DiceObserver: handle negative numbers
This commit is contained in:
@@ -30,9 +30,12 @@ class DiceObserver(PrivMsgObserverPrototype):
|
||||
if dice_sides == 0:
|
||||
connection.send_back(data['nick'] + ' wirft einen 0-seitigen Würfel und bekommt Unendlich.', data)
|
||||
return
|
||||
elif dice_sides < 0:
|
||||
connection.send_back(data['nick'] + ' wirft einen ' + str(dice_sides) + '-seitigen Würfel und nichts passiert.', data)
|
||||
return
|
||||
elif dice_sides[0] == '-':
|
||||
dice_sides = dice_sides.replace('-', '')
|
||||
if dice_sides.isdigit():
|
||||
dice_sides = int(dice_sides)*(-1)
|
||||
connection.send_back(data['nick'] + ' wirft einen ' + str(dice_sides) + '-seitigen Würfel und nichts passiert.', data)
|
||||
return
|
||||
else:
|
||||
dice_sides = 6
|
||||
|
||||
|
||||
Reference in New Issue
Block a user