Added choose command

This commit is contained in:
mrhanky 2017-05-29 13:29:23 +02:00
parent 584117bb0d
commit 99afe042cd
No known key found for this signature in database
GPG Key ID: 67D772C481CB41B8

View File

@ -55,6 +55,16 @@ class Useless(Plugin):
for face in (':O C==3', ':OC==3', ':C==3', ':C=3', ':C3', ':3'): for face in (':O C==3', ':OC==3', ':C==3', ':C=3', ':C3', ':3'):
self.bot.privmsg(channel, face) self.bot.privmsg(channel, face)
@command
def choose(self, mask: IrcString, channel: IrcString, args: DocOptDict):
"""Decides between items separated by comma.
%%choose <items>...
"""
choice = random.choice(' '.join(args['<items>']).split(','))
return '{nick}, I\'d choose: {choice}'.format(nick=mask.nick,
choice=choice.strip())
@command @command
def jn(self, mask: IrcString, channel: IrcString, args: DocOptDict): def jn(self, mask: IrcString, channel: IrcString, args: DocOptDict):
"""Decides between yes and no (for a question). """Decides between yes and no (for a question).