Created
July 24, 2012 01:28
-
-
Save chancez/3167356 to your computer and use it in GitHub Desktop.
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
# Treat messages starting with '!' as commands (e.g., "!say hi") | |
if msg[0] == '!': | |
# Splits up the orginal message into 2 parts: | |
# command = the command to be called, Ex: !rps | |
# cmd_args = the arguments for the command, ex: !rps args | |
cmd = msg.split(' ',1) | |
command = cmd[0] | |
command = command[1:] # Removes the ! from the command | |
cmd_args = cmd[1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment