mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-11 14:41:58 +02:00
Update DiceObserver: handle negative numbers
This commit is contained in:
@@ -30,7 +30,10 @@ class DiceObserver(PrivMsgObserverPrototype):
|
|||||||
if dice_sides == 0:
|
if dice_sides == 0:
|
||||||
connection.send_back(data['nick'] + ' wirft einen 0-seitigen Würfel und bekommt Unendlich.', data)
|
connection.send_back(data['nick'] + ' wirft einen 0-seitigen Würfel und bekommt Unendlich.', data)
|
||||||
return
|
return
|
||||||
elif dice_sides < 0:
|
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)
|
connection.send_back(data['nick'] + ' wirft einen ' + str(dice_sides) + '-seitigen Würfel und nichts passiert.', data)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user