#Using the same autocomplete function for multiple commands
1 messages · Page 1 of 1 (latest)
ok, i've coded it up and it doesn"t show ```@global_autocomplete(option_name="icao")
async def autocomplete( ctx: AutocompleteContext):
# make sure this is done within three seconds
choices = []
for x,icao in enumerate(await list_apt()):
if ctx.input_text == "":
if len(choices) < 25:
choices.append({
"name": f"{icao}",
"value": f"{icao}",
})
if icao.startswith((ctx.input_text)) :
if len(choices) < 25:
choices.append({
"name": f"{icao}",
"value": f"{icao}",
})
await ctx.send(
choices=choices
)```