Compare commits

..

No commits in common. "d9027356abeba6983f7bc71b7320730060a97f9b" and "8a331e0c7b509a36b5e32720f8486c197a744534" have entirely different histories.

View file

@ -94,6 +94,7 @@ 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 \
@ -101,6 +102,11 @@ 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'''
@ -114,4 +120,4 @@ def generate_response(parsed_command):
case 'help': case 'help':
return do_help(command) return do_help(command)
case _: case _:
return None return do_invalid_command(command, full_user)