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
|
# Colorize owe amount and return string
|
||||||
if owes:
|
if owes:
|
||||||
fines = '4${fines}'.format(fines=owes['fines'])
|
fines = '4${}'.format(owes['fines'])
|
||||||
else:
|
else:
|
||||||
fines = '3$0'
|
fines = '3$0'
|
||||||
|
|
||||||
|
@ -47,10 +47,14 @@ class Rape(DatabasePlugin):
|
||||||
rand = random.randint(0, 3)
|
rand = random.randint(0, 3)
|
||||||
|
|
||||||
if rand not in (0, 1):
|
if rand not in (0, 1):
|
||||||
self.bot.action(target, 'rapes {nick}'.format(nick=nick))
|
self.bot.action(target, 'rapes {}'.format(nick))
|
||||||
else:
|
else:
|
||||||
fine = random.randint(1, 500)
|
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
|
# Insert or add fine to database and return total owe
|
||||||
self.cur.execute('''
|
self.cur.execute('''
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
|
@ -61,15 +65,12 @@ class Rape(DatabasePlugin):
|
||||||
fines = users.fines + excluded.fines
|
fines = users.fines + excluded.fines
|
||||||
RETURNING
|
RETURNING
|
||||||
fines
|
fines
|
||||||
''', [mask.nick, fine])
|
''', [fined, fine])
|
||||||
self.con.commit()
|
self.con.commit()
|
||||||
|
|
||||||
# Get reason based on rand value
|
|
||||||
reason = ('raping', 'being too lewd and getting raped')[rand]
|
|
||||||
|
|
||||||
# Print fine and total owe
|
# Print fine and total owe
|
||||||
self.bot.action(target, 'fines {nick} \x02${fine}\x02 for {reason}. You owe: \x0304${total}\x03'.format(
|
self.bot.action(target, 'fines {nick} \x02${fine}\x02 for {reason}. You owe: \x0304${total}\x03'.format(
|
||||||
nick=mask.nick,
|
nick=fined,
|
||||||
fine=fine,
|
fine=fine,
|
||||||
reason=reason,
|
reason=reason,
|
||||||
total=self.cur.fetchone()['fines'],
|
total=self.cur.fetchone()['fines'],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user