71 lines
2.5 KiB
Python
71 lines
2.5 KiB
Python
def get_help_message(method):
|
|
"""
|
|
get_help_message(method)
|
|
|
|
Returns the information and usage of each of dragon bot's funtions.
|
|
When adding a new feature to dragon bot, please add some information about
|
|
it here
|
|
"""
|
|
|
|
supported_methods = {
|
|
'8ball': [
|
|
'Ask dragon bot a question and it will give you an 8ball response',
|
|
'\n\nUsage: !8ball Will I win the lottery tomorrow?'
|
|
],
|
|
'decide': [
|
|
'Dragon-bot will help make the tough decisions for you',
|
|
'\n\n!decide option 1 or option 2.\n\nIf thre is only',
|
|
'one option, it will give you a yes or no'
|
|
],
|
|
'define': [
|
|
'Returns a definiton of a word from urban dictionary',
|
|
'\n\nUsage: !define loli'
|
|
],
|
|
'docker': [
|
|
'Two supported actions: logs and restart\n\nlogs: Shows you the',
|
|
'last X number of lines from the minecraft server. If no number',
|
|
'is specified, defaults to 10.\n\nrestart: will restart the min',
|
|
'ecraft server if something is fucky'
|
|
],
|
|
'excuse': [
|
|
'Generates a random excuse you can give your boss'],
|
|
'help': [
|
|
'Prints out a list of everything dragon-bot can do'
|
|
],
|
|
'lewd': [
|
|
'Returns a URL for a lewd image.',
|
|
'Can only be used in NSFW channels'
|
|
],
|
|
'purge': [
|
|
'Deletes the last 20 messages you sent from the channel you',
|
|
'typed purge in, unless otherwise specified. eg. !purge 8'
|
|
],
|
|
'triggered': [
|
|
'REEEEEEEEEEEEEEEEEE'],
|
|
'wallpaper': [
|
|
'Returns the URL for a 4k wallpaper. You can enter',
|
|
'a search term as well, for example, !wallpaper, or',
|
|
', !wallpaper flowers. Supports multiple tags.'
|
|
]
|
|
}
|
|
|
|
if method == 'show_all':
|
|
count = len(supported_methods)
|
|
keys = ', '.join(supported_methods.keys())
|
|
|
|
message = "I currently have `{}` methods,\n\n```{}```\n\nYou can get in formation about a specific method by typing !help <method>".format(count, keys)
|
|
else:
|
|
message = ' '.join(supported_methods[method])
|
|
return message
|
|
|
|
def parse_message(message):
|
|
if len(message.split()) > 1:
|
|
method = message.split()[1]
|
|
try:
|
|
explanation = get_help_message(method)
|
|
except KeyError:
|
|
return "I can't help you with that"
|
|
return "```{}```".format(explanation)
|
|
|
|
return get_help_message('show_all')
|