Last active
March 25, 2018 02:48
-
-
Save Bert-Macklin/289cb03cea20caa7d8e1cdb16a2f65ca to your computer and use it in GitHub Desktop.
Making a Discord Bot in Python 3
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
# command's function | |
def hello_function(message,client,args): | |
try: | |
return 'Hello {}, Argument One: {}'.format(message.author, args[0]) | |
except Exception as e: | |
return e | |
# hello command dictionary | |
hello_command = { | |
# if the string starts with this the function will be called | |
'trigger': '!hello', | |
# specifies the function to call | |
'function': hello_function, | |
# number of arguments that the functions needs | |
'args_num': 1, | |
# name of the argument that the funtions takes | |
'args_name': ['string'], | |
# describes what the function does | |
'description': 'Will respond hello to the caller and show arg 1' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment