From 98243dcf69987614557c43bfb5af900d220307e9 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 8 Sep 2023 14:05:02 -0400 Subject: [PATCH] fix(forums): added a proper error message to resolvedset tag if the target channel is not a forums channel --- forums/forums.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/forums/forums.py b/forums/forums.py index e811e12..e12b6d2 100644 --- a/forums/forums.py +++ b/forums/forums.py @@ -179,11 +179,14 @@ class Forums(commands.Cog): await ctx.send(f"{channel.mention} is not a forums channel!") @resolvedset.command(name="tag") - async def resolvedset_tag(self, ctx: commands.Context, channel: discord.ForumChannel): + async def resolvedset_tag(self, ctx: commands.Context, channel: discord.abc.GuildChannel): """Sets the tag used by the [p]resolved command.""" - options = self.create_select_options(ctx, channel.available_tags) - msg = await ctx.send("Select a forum tag below.") - await msg.edit(view=SelectView(msg, options)) + if not isinstance(channel, discord.ForumChannel): + await ctx.send(f"{channel.mention} is not a forums channel!") + else: + options = self.create_select_options(ctx, channel.available_tags) + msg = await ctx.send("Select a forum tag below.") + await msg.edit(view=SelectView(msg, options)) class Select(ui.Select): def __init__(self, message, options):