Skip to content

Instantly share code, notes, and snippets.

@Bert-Macklin
Last active March 25, 2018 02:48
Show Gist options
  • Save Bert-Macklin/289cb03cea20caa7d8e1cdb16a2f65ca to your computer and use it in GitHub Desktop.
Save Bert-Macklin/289cb03cea20caa7d8e1cdb16a2f65ca to your computer and use it in GitHub Desktop.
Making a Discord Bot in Python 3
# 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