Fixed rape
This commit is contained in:
parent
7924d9119e
commit
3a7bb88a7d
15
bot/rape.py
15
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'],
|
||||
|
|
Loading…
Reference in New Issue
Block a user