Skip to content

Commit

Permalink
Search now searches through command aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyscripts committed Jan 27, 2025
1 parent 250f772 commit f8f116f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion commands/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion themes/ghost.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"image": "https://cdn.discordapp.com/icons/1302632843176050738/e7f5c4fa0080423094fd8025f3f8d5a1.png?size=1024",
"colour": "#575757",
"footer": "ghost aint dead"
}
}

0 comments on commit f8f116f

Please sign in to comment.