Skip to content

Instantly share code, notes, and snippets.

@1stvamp
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1stvamp/c6bb20ba6d7a727502b0 to your computer and use it in GitHub Desktop.
Save 1stvamp/c6bb20ba6d7a727502b0 to your computer and use it in GitHub Desktop.
Example of returning multiple directed commands in a hippybot plugin
from hippybot.decorators import botcmd
class Plugin(object):
command_aliases = {'^5s': 'high_fives'}
@botcmd
def high_fives(self, msg, **kwargs):
users = [
unicode(msg.getFrom()).split("/")[1].replace(' ', ''),
'bob',
'alice']
replies = []
for user in users:
replies.append('@{} {}'.format(user, '^5!'))
return '\n'.join(replies)
@1stvamp
Copy link
Author

1stvamp commented May 12, 2015

Example always high-fives bob, alice and the original user that typed ^5s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment