Add tag list command, closes #172
This commit is contained in:
parent
158591acac
commit
d03e9a08e8
1 changed files with 7 additions and 0 deletions
|
@ -312,6 +312,13 @@ class TagCog(Extension):
|
|||
|
||||
await ctx.send(embeds=embed)
|
||||
|
||||
@tag.subcommand(sub_cmd_name="list", sub_cmd_description="List tag names")
|
||||
async def _list(self, ctx: InteractionContext) -> None:
|
||||
tags = await Tag.find(q(guild=ctx.guild.id)).to_list(None)
|
||||
names = "\n".join(f"`{t.name}`" for t in tags)
|
||||
embed = build_embed(title="All Tags", description=names, fields=[])
|
||||
await ctx.send(embeds=embed)
|
||||
|
||||
@_get.autocomplete("name")
|
||||
@_edit.autocomplete("name")
|
||||
@_delete.autocomplete("name")
|
||||
|
|
Loading…
Add table
Reference in a new issue