Last active
August 29, 2015 14:21
-
-
Save 1stvamp/c6bb20ba6d7a727502b0 to your computer and use it in GitHub Desktop.
Example of returning multiple directed commands in a hippybot plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example always high-fives bob, alice and the original user that typed
^5s