does this make you smile?

This commit is contained in:
Cephra 2017-08-18 11:31:56 +02:00
parent 3808ac60d2
commit 7370b26a43

View File

@ -317,6 +317,21 @@ class Useless(DatabasePlugin):
""" """
return ' '.join([self._rainbow(i, word) for i, word in enumerate(args['<words>'])]) return ' '.join([self._rainbow(i, word) for i, word in enumerate(args['<words>'])])
@command
def asshole(self, mask: IrcString, target: IrcString, args: DocOptDict):
"""Checks how much of an asshole you are.
%%asshole [<nick>]
"""
nick = args.get('<nick>') or mask.nick
asshole_perc = random.randint(0,100)
if nick == 'mrhanky':
asshole_perc = 100
return '{} is {}% of an asshole.'.format(nick, asshole_perc)
# noinspection PyMethodMayBeStatic # noinspection PyMethodMayBeStatic
def _rainbow(self, i, char): def _rainbow(self, i, char):
return '\x03{0:02d}{1}'.format(RAINBOW[i % RAINBOW_LEN], char) return '\x03{0:02d}{1}'.format(RAINBOW[i % RAINBOW_LEN], char)