Added doc for setting waifu/husbando)

This commit is contained in:
mrhanky 2017-08-22 15:19:57 +02:00
parent 9d1602046d
commit cc279c39e0
No known key found for this signature in database
GPG Key ID: 67D772C481CB41B8

View File

@ -125,7 +125,7 @@ class Useless(DatabasePlugin):
@command
def waifu(self, mask: IrcString, target: IrcString, args: DocOptDict):
"""Get waifu for a user
"""Get waifu for a user (set with prefixing the user with =)
%%waifu [<nick>...]
"""
@ -158,14 +158,14 @@ class Useless(DatabasePlugin):
WHERE
lower(nick) = lower(%s)
''', [nick])
result = self.cur.fetchone()
result = self.cur.fetchone()['waifu']
if result and result['waifu']:
return '\x02[Waifu]\x02 {}: {}'.format(nick, result['waifu'])
if result:
return '\x02[Waifu]\x02 {}: {}'.format(nick, result)
@command
def husbando(self, mask: IrcString, target: IrcString, args: DocOptDict):
"""Get husbando for a user
"""Get husbando for a user (set with prefixing the user with =)
%%husbando [<nick>...]
"""
@ -198,10 +198,10 @@ class Useless(DatabasePlugin):
WHERE
lower(nick) = lower(%s)
''', [nick])
result = self.cur.fetchone()
result = self.cur.fetchone()['husbando']
if result and result['husbando']:
return '\x02[Husbando]\x02 {}: {}'.format(nick, result['husbando'])
if result:
return '\x02[Husbando]\x02 {}: {}'.format(nick, result)
@command
def storyofpomfface(self, mask: IrcString, target: IrcString,