Fixes n shit
This commit is contained in:
parent
f8bf6b6d55
commit
57df82943b
|
@ -144,11 +144,10 @@ def migrate_users():
|
||||||
try:
|
try:
|
||||||
cur.execute('''
|
cur.execute('''
|
||||||
insert into
|
insert into
|
||||||
users (nick, host, husbando, waifu, fines)
|
users (nick, husbando, waifu, fines)
|
||||||
values
|
values
|
||||||
(%s, %s, %s, %s, %s)
|
(%s, %s, %s, %s)
|
||||||
''', [u['nick'].strip(),
|
''', [u['nick'].strip(),
|
||||||
u['mask'].strip() if u['mask'] else None,
|
|
||||||
husbando,
|
husbando,
|
||||||
waifu,
|
waifu,
|
||||||
fines])
|
fines])
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Coins(Plugin):
|
||||||
|
|
||||||
@command
|
@command
|
||||||
def btc(self, mask: IrcString, target: IrcString, args: DocOptDict):
|
def btc(self, mask: IrcString, target: IrcString, args: DocOptDict):
|
||||||
"""Gets the Bitcoin values from BitStamp.
|
"""Gets the Bitcoin values from cryptowatch.
|
||||||
|
|
||||||
%%btc [<currency>]
|
%%btc [<currency>]
|
||||||
"""
|
"""
|
||||||
|
@ -31,7 +31,7 @@ class Coins(Plugin):
|
||||||
|
|
||||||
@command
|
@command
|
||||||
def eth(self, mask: IrcString, target: IrcString, args: DocOptDict):
|
def eth(self, mask: IrcString, target: IrcString, args: DocOptDict):
|
||||||
"""Gets the Ethereum values from etherscan.io.
|
"""Gets the Ethereum values from cryptowatch.
|
||||||
|
|
||||||
%%eth [<currency>]
|
%%eth [<currency>]
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -61,7 +61,7 @@ class Quotes(DatabasePlugin):
|
||||||
|
|
||||||
@command(options_first=True)
|
@command(options_first=True)
|
||||||
def q(self, mask: IrcString, target: IrcString, args: DocOptDict):
|
def q(self, mask: IrcString, target: IrcString, args: DocOptDict):
|
||||||
"""Get, add or delete quots for a user
|
"""Get, add or delete quotes for an user.
|
||||||
|
|
||||||
%%q <cmd> <nick> <quote>...
|
%%q <cmd> <nick> <quote>...
|
||||||
%%q <nick> [<index>]
|
%%q <nick> [<index>]
|
||||||
|
|
|
@ -63,12 +63,12 @@ class Rape(DatabasePlugin):
|
||||||
insert into
|
insert into
|
||||||
users (nick, fines)
|
users (nick, fines)
|
||||||
values
|
values
|
||||||
(%s, %s, %s)
|
(%s, %s)
|
||||||
on conflict (nick) do update set
|
on conflict (nick) do update set
|
||||||
fines = users.fines + excluded.fines
|
fines = users.fines + excluded.fines
|
||||||
returning
|
returning
|
||||||
fines
|
fines
|
||||||
''', [nick, fine])
|
''', [mask.nick, fine])
|
||||||
self.con.commit()
|
self.con.commit()
|
||||||
|
|
||||||
# Get reason based on rand value
|
# Get reason based on rand value
|
||||||
|
@ -78,7 +78,7 @@ class Rape(DatabasePlugin):
|
||||||
self.bot.action(target,
|
self.bot.action(target,
|
||||||
'fines {nick} \x02${fine}\x02 for {reason}. '
|
'fines {nick} \x02${fine}\x02 for {reason}. '
|
||||||
'You owe: \x0304${total}\x03'
|
'You owe: \x0304${total}\x03'
|
||||||
.format(nick=nick,
|
.format(nick=mask.nick,
|
||||||
fine=fine,
|
fine=fine,
|
||||||
reason=reason,
|
reason=reason,
|
||||||
total=self.cur.fetchone()['fines']))
|
total=self.cur.fetchone()['fines']))
|
||||||
|
|
|
@ -169,7 +169,7 @@ class Useless(DatabasePlugin):
|
||||||
%%choose <items>...
|
%%choose <items>...
|
||||||
"""
|
"""
|
||||||
choice = random.choice(' '.join(args['<items>']).split(','))
|
choice = random.choice(' '.join(args['<items>']).split(','))
|
||||||
return '{nick}, I\'d choose: {choice}'.format(nick=mask.nick,
|
return '{nick}: {choice}'.format(nick=mask.nick,
|
||||||
choice=choice.strip())
|
choice=choice.strip())
|
||||||
|
|
||||||
@command
|
@command
|
||||||
|
|
|
@ -25,10 +25,14 @@ class Weather(Plugin):
|
||||||
req = requests.get(self.URL.format(' '.join(args['<location>'])))
|
req = requests.get(self.URL.format(' '.join(args['<location>'])))
|
||||||
data = req.json()
|
data = req.json()
|
||||||
if 'error' in data:
|
if 'error' in data:
|
||||||
return '[Weather] Location not found'
|
return '\x02[Weather]\x0F Error'
|
||||||
|
elif not data['query']['results']:
|
||||||
|
return '\x02[Weather]\x0F Location not found'
|
||||||
|
else:
|
||||||
res = data['query']['results']['channel']
|
res = data['query']['results']['channel']
|
||||||
return '[Weather] {city}, {region}, {country}: {temp}°{unit_temp} ' \
|
return '\x02[Weather]\x0F {city}, {region}, {country}: ' \
|
||||||
'{text}, {direction} {speed} {unit_speed}' \
|
'\x02{temp}°{unit_temp} {text}\x0F, ' \
|
||||||
|
'\x02{direction} {speed} {unit_speed}\x0F' \
|
||||||
.format(city=res['location']['city'],
|
.format(city=res['location']['city'],
|
||||||
region=res['location']['region'].strip(),
|
region=res['location']['region'].strip(),
|
||||||
country=res['location']['country'],
|
country=res['location']['country'],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user