6693186d40
This Commit Contained Rebrand Patches
16 lines
440 B
Python
16 lines
440 B
Python
from discord import AutocompleteContext
|
|
|
|
from RUNA.Database.MeiliSearch import Snowball
|
|
|
|
|
|
async def Guild_Autocomplete(ctx: AutocompleteContext):
|
|
snowball = Snowball()
|
|
query = ctx.value
|
|
print(query)
|
|
result = await snowball.query_guild(query)
|
|
results = []
|
|
for i in result["hits"]:
|
|
gname = i["guild_name"]
|
|
gid = i["guild_id"]
|
|
results.append(f"{gname} ({gid})")
|
|
return results |