From ea9b6f32dcef4439ecfb04a3532f8a581cb45020 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sat, 25 Aug 2018 20:09:44 +0100 Subject: Prevent users sending coins to themselves --- modules/coins.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/coins.py b/modules/coins.py index d340529e..bf53d18e 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -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 -- cgit v1.3.1-10-gc9f91