change status message if invalid number of arguments

This commit is contained in:
Adora Laura Kalb 2024-01-01 18:18:25 +01:00
parent a308436410
commit 048eab9a3a
Signed by: adoralaura
GPG key ID: 7A4552166FC8C056

8
app.py
View file

@ -98,7 +98,13 @@ async def on_message(message):
await message.channel.send(f"Sorry {message.author.mention}, that didn't work. Ping @lauralani")
if command == "status":
if len(messagearray) != 2:
if len(messagearray) < 2:
logger.error(
f"Status with no arguments by {message.author.name}. Command: \"{message.content}\"")
await message.add_reaction("")
await message.channel.send(f"{message.author.name}: This comand is for checking the status of a single game!\nDid you maybe mean to use the `info` command to display all games?")
return
if len(messagearray) > 2:
logger.error(
f"Status with invalid numer of arguments by {message.author.name}. Command: \"{message.content}\"")
await message.add_reaction("")