feat(forums): added forumconfig channel command
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
parent
67ed8aedc6
commit
96ced7982e
1 changed files with 6 additions and 1 deletions
|
@ -105,13 +105,18 @@ class Forums(commands.Cog):
|
|||
options.append(discord.SelectOption(label=tag.name, emoji=emoji, description="", value=tag.id))
|
||||
return options
|
||||
|
||||
@forumsconfig.command(name="tagset")
|
||||
@forumsconfig.command(name="tag")
|
||||
async def forumsconfig_tag_set(self, ctx: commands.Context, channel: discord.ForumChannel):
|
||||
options = self.create_select_options(ctx, channel.available_tags)
|
||||
tag = channel.get_tag(await self.config.guild(ctx.guild).forum_tag())
|
||||
msg = await ctx.send(f"Forum tag is currently set to `{str(tag)}`.")
|
||||
await msg.edit(view=SelectView(msg, options))
|
||||
|
||||
@forumsconfig.command(name="channel")
|
||||
async def forumsconfig_channel_set(self, ctx: commands.Context, channel: discord.ForumChannel):
|
||||
await self.config.guild(ctx.guild).forum_channel.set(channel.id)
|
||||
await ctx.send(f"Forum channel has been set to `{channel.name}`.")
|
||||
|
||||
class Select(ui.Select):
|
||||
def __init__(self, message, options):
|
||||
self.message = message
|
||||
|
|
Loading…
Reference in a new issue