From f8f116f72b842fdbebab3b0eccb6c24084361942 Mon Sep 17 00:00:00 2001 From: bennyscripts <83777519+bennyscripts@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:40:20 +0000 Subject: [PATCH] Search now searches through command aliases --- commands/general.py | 9 ++++++++- themes/ghost.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/commands/general.py b/commands/general.py index a032888..d725730 100755 --- a/commands/general.py +++ b/commands/general.py @@ -94,9 +94,16 @@ async def search(self, ctx, query: str, selected_page: int = 1): commands_2 = [] spacing = 0 pages = [] + + def search_aliases(command, query): + for alias in command.aliases: + if query in alias: + return True + + return False for cmd in commands: - if query in cmd.name or query in cmd.description: + if query in cmd.name or query in cmd.description or search_aliases(cmd, query): prefix = cmdhelper.get_command_full_name(cmd) if len(prefix) > spacing: diff --git a/themes/ghost.json b/themes/ghost.json index bf6c942..cbd4b10 100644 --- a/themes/ghost.json +++ b/themes/ghost.json @@ -4,4 +4,4 @@ "image": "https://cdn.discordapp.com/icons/1302632843176050738/e7f5c4fa0080423094fd8025f3f8d5a1.png?size=1024", "colour": "#575757", "footer": "ghost aint dead" -} +} \ No newline at end of file