diff --git a/aurora/aurora.py b/aurora/aurora.py index e7bf1bf..bf99150 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -11,6 +11,7 @@ import os import time from datetime import datetime, timedelta, timezone from math import ceil +from typing import List import discord from class_registry.registry import RegistryKeyError @@ -767,6 +768,21 @@ class Aurora(commands.Cog): await interaction.followup.send(embed=embed, ephemeral=ephemeral) + @history.autocomplete('types') + async def _history_types(self, interaction: discord.Interaction, current: str) -> List[app_commands.Choice[str]]: + types: List[str] = sorted(self.type_registry.keys()) + choices = list() + if current.endswith(","): + for c in current.split(","): + if c in types: + types.remove(c) + for t in types: + choices.append(app_commands.Choice(name=current+t, value=current+t)) + else: + for t in types: + choices.append(app_commands.Choice(name=t, value=t)) + return choices[:25] + @app_commands.command(name="resolve") async def resolve( self, interaction: discord.Interaction, case: int, reason: str | None = None