calendar command qol
This commit is contained in:
1 parent
61de4c3933
commit
f8c7fc4fc6
2 files changed
+14
-5
No files matched your search
+12
-3
@@ -48,7 +48,16 @@ COUNTRY_TZ: dict[str, float] = {
|
||||
# fmt: on
|
||||
|
||||
|
||||
def tz_choices() -> list:
|
||||
"""Return app_commands.Choice list for the country dropdown."""
|
||||
async def country_autocomplete(
|
||||
_interaction,
|
||||
current: str,
|
||||
) -> list:
|
||||
"""Return matching countries for slash-command autocomplete."""
|
||||
from discord import app_commands
|
||||
return [app_commands.Choice(name=c, value=c) for c in sorted(COUNTRY_TZ)]
|
||||
current = current.lower()
|
||||
matches = [
|
||||
app_commands.Choice(name=c, value=c)
|
||||
for c in sorted(COUNTRY_TZ)
|
||||
if current in c.lower()
|
||||
]
|
||||
return matches[:25] # Discord limits to 25 suggestions
|
||||
Reference in new issue
Block a user