Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Botsnack.

  • Loading branch information...
commit a045c2cea9291a65fb89b62911bb6576112e37ca 1 parent fcd430b
@mythmon mythmon authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 hamper/plugins/friendly.py
View
24 hamper/plugins/friendly.py
@@ -53,5 +53,29 @@ def process(self, bot, comm):
return False
+class BotSnack(object):
+ """Reward a good bot."""
+ implements(IPlugin)
+
+ name = 'botsnack'
+ priority = 0
+
+ def setup(self, factory):
+ self.rewards = {
+ 'botsnack': ['yummy', 'my favorite!'],
+ 'goodhamper': ['^_^', ':D'],
+ }
+
+ def process(self, bot, comm):
+ slug = comm['message'].lower().replace(' ', '')
+ for k, v in self.rewards.items():
+ if k in slug:
+ bot.say(comm['channel'], random.choice(v))
+ return True
+
+ return False
+
+
friendly = Friendly()
omgponies = OmgPonies()
+botsnack = BotSnack()
Please sign in to comment.
Something went wrong with that request. Please try again.