From 3a7bb88a7dc84ecffb7830090ddbe087b71d12d4 Mon Sep 17 00:00:00 2001 From: mrhanky Date: Tue, 22 Aug 2017 21:20:43 +0200 Subject: [PATCH] Fixed rape --- bot/rape.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bot/rape.py b/bot/rape.py index 6cb25b2..6fb21d6 100644 --- a/bot/rape.py +++ b/bot/rape.py @@ -30,7 +30,7 @@ class Rape(DatabasePlugin): # Colorize owe amount and return string if owes: - fines = '4${fines}'.format(fines=owes['fines']) + fines = '4${}'.format(owes['fines']) else: fines = '3$0' @@ -47,10 +47,14 @@ class Rape(DatabasePlugin): rand = random.randint(0, 3) if rand not in (0, 1): - self.bot.action(target, 'rapes {nick}'.format(nick=nick)) + self.bot.action(target, 'rapes {}'.format(nick)) else: fine = random.randint(1, 500) + # Get reason based on rand value + fined = (mask.nick, nick)[rand] + reason = ('raping', 'being too lewd and getting raped')[rand] + # Insert or add fine to database and return total owe self.cur.execute(''' INSERT INTO @@ -61,15 +65,12 @@ class Rape(DatabasePlugin): fines = users.fines + excluded.fines RETURNING fines - ''', [mask.nick, fine]) + ''', [fined, fine]) self.con.commit() - # Get reason based on rand value - reason = ('raping', 'being too lewd and getting raped')[rand] - # Print fine and total owe self.bot.action(target, 'fines {nick} \x02${fine}\x02 for {reason}. You owe: \x0304${total}\x03'.format( - nick=mask.nick, + nick=fined, fine=fine, reason=reason, total=self.cur.fetchone()['fines'],