feat(forums): reworked how resolvedset tag works, no longer takes a forumchannel argument
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
Seaswimmer 2023-09-08 14:12:49 -04:00
parent 5eceb484f3
commit 82d556a4e5
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -179,14 +179,12 @@ class Forums(commands.Cog):
await ctx.send(f"{channel.mention} is not a forums channel!") await ctx.send(f"{channel.mention} is not a forums channel!")
@resolvedset.command(name="tag") @resolvedset.command(name="tag")
async def resolvedset_tag(self, ctx: commands.Context, channel: discord.abc.GuildChannel): async def resolvedset_tag(self, ctx: commands.context):
"""Sets the tag used by the [p]resolved command.""" """Sets the tag used by the [p]resolved command."""
if not isinstance(channel, discord.ForumChannel): channel: discord.ForumChannel = ctx.guild.get_channel(await self.config.guild(ctx.guild).forum_channel())
await ctx.send(f"{channel.mention} is not a forums channel!") options = self.create_select_options(ctx, channel.available_tags)
else: msg = await ctx.send("Select a forum tag below.")
options = self.create_select_options(ctx, channel.available_tags) await msg.edit(view=SelectView(msg, options))
msg = await ctx.send("Select a forum tag below.")
await msg.edit(view=SelectView(msg, options))
class Select(ui.Select): class Select(ui.Select):
def __init__(self, message, options): def __init__(self, message, options):