forked from waifu/kemoverse
Merge pull request 'Remove 'Invalid command' Response' (#24) from fix/remove_invalid_command_response into dev
Reviewed-on: waifu/kemoverse#24
This commit is contained in:
commit
d9027356ab
1 changed files with 1 additions and 7 deletions
|
@ -94,7 +94,6 @@ def do_create(full_user, arguments, note_obj):
|
||||||
)
|
)
|
||||||
return([f'{full_user}Added {arguments[0]}, ID {character_id}.',[file_id]])
|
return([f'{full_user}Added {arguments[0]}, ID {character_id}.',[file_id]])
|
||||||
|
|
||||||
|
|
||||||
def do_help(full_user):
|
def do_help(full_user):
|
||||||
'''Provides a list of commands that the bot can do.'''
|
'''Provides a list of commands that the bot can do.'''
|
||||||
return f'{full_user} Here\'s what I can do:\n \
|
return f'{full_user} Here\'s what I can do:\n \
|
||||||
|
@ -102,11 +101,6 @@ def do_help(full_user):
|
||||||
- `create <name> <rarity> <weight>` Creates a character using a given image.\
|
- `create <name> <rarity> <weight>` Creates a character using a given image.\
|
||||||
- `help` Shows this message'
|
- `help` Shows this message'
|
||||||
|
|
||||||
def do_invalid_command(command, full_user):
|
|
||||||
'''Generic response when an unknown or invalid command is sent'''
|
|
||||||
return f'{full_user} Unrecognised command: {command}\n\
|
|
||||||
Message \'help\' to get a list of valid commands'
|
|
||||||
|
|
||||||
def generate_response(parsed_command):
|
def generate_response(parsed_command):
|
||||||
'''Given a command with arguments, processes the game state and
|
'''Given a command with arguments, processes the game state and
|
||||||
returns a response'''
|
returns a response'''
|
||||||
|
@ -120,4 +114,4 @@ def generate_response(parsed_command):
|
||||||
case 'help':
|
case 'help':
|
||||||
return do_help(command)
|
return do_help(command)
|
||||||
case _:
|
case _:
|
||||||
return do_invalid_command(command, full_user)
|
return None
|
||||||
|
|
Loading…
Add table
Reference in a new issue