Prevent users sending coins to themselves

This commit is contained in:
jesopo 2018-08-25 20:09:44 +01:00
parent da74357807
commit ea9b6f32dc

View file

@ -140,6 +140,9 @@ class Module(object):
"" if coin_bet == 1 else "s"))
def send(self, event):
if event["user"].nickname_lower == event["args_split"][0].lower():
event["stderr"].write("You can't send coins to yourself")
return
send_amount = event["args_split"][1]
match = REGEX_FLOAT.match(send_amount)
if not match or round(decimal.Decimal(send_amount), 2