feat(forums): added forumconfig channel command
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
Seaswimmer 2023-09-07 19:01:41 -04:00
parent 67ed8aedc6
commit 96ced7982e
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -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