Only compare lower case strings for autocomplete + userconfig command
All checks were successful
Build Heidi Docker image / build-docker (push) Successful in 8s

This commit is contained in:
2023-11-25 20:21:42 +01:00
parent 7250d7bb7d
commit a34e4fc01b

15
bot.py
View File

@ -192,6 +192,17 @@ async def on_message(message):
break
# Config Commands --------------------------------------------------------------------------------
@client.tree.command(
name="userconfig",
description="User-spezifische Heidi-Einstellungen (Heidi merkt sie sich in ihrem riesigen Gehirn)."
)
async def user_config(interaction: discord.Interaction):
pass
# Commands ---------------------------------------------------------------------------------------
@ -298,7 +309,7 @@ async def board_autocomplete(
boards: List[str] = os.listdir(SOUNDDIR)
return [
Choice(name=board, value=board) for board in boards if board.startswith(current)
Choice(name=board, value=board) for board in boards if board.lower().startswith(current.lower())
]
@ -311,7 +322,7 @@ async def sound_autocomplete(
)
return [
Choice(name=sound, value=sound) for sound in sounds if sound.startswith(current)
Choice(name=sound, value=sound) for sound in sounds if sound.lower().startswith(current.lower())
]