Skip to content

Instantly share code, notes, and snippets.

@chancez
Created July 24, 2012 01:28
Show Gist options
  • Save chancez/3167356 to your computer and use it in GitHub Desktop.
Save chancez/3167356 to your computer and use it in GitHub Desktop.
# 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