--- a/rollbot.py Wed Jul 20 00:32:32 2016 +0800
+++ b/rollbot.py Wed Apr 04 00:09:27 2018 +0800
return '%s usage: %s' % (self.name, self.usage())
+ action = ('eats', 'devours', 'swallows', 'gorges on', 'feasts upon', 'gobbles up')
+ food = ('banana', 'cookie', 'durian', 'fig', 'garlic', 'kiwi', 'lemon', 'mango', 'pomegranate', 'tamarind')
+ return '{t}%s{/t} {i}or{/i} {t}%s <snack>{/t}' % (self.name, self.name)
+ def respond(self, words, message):
+ return '/me %s a %s' % (random.choice(self.action), random.choice(self.food))
+ return '/me eats a %s' % ' '.join(words[1:])
+ return '%s usage: %s' % (self.name, self.usage())
class RollBot(sleekxmpp.ClientXMPP):
def __init__(self, jid, password, nick, prefix):
sleekxmpp.ClientXMPP.__init__(self, jid, password)
+ self.add_command(Snack)
self.add_event_handler('session_start', self.start)
self.add_event_handler('message', self.message)