From 5d4a4acb8e579ec12a5420ec74f386d55b8b60ed Mon Sep 17 00:00:00 2001 From: Solumath Date: Sun, 1 Sep 2024 18:40:48 +0200 Subject: [PATCH] fix: subscription autocomplete error on empty channel --- cogs/subscriptions/cog.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogs/subscriptions/cog.py b/cogs/subscriptions/cog.py index 60aa01682..2d008ca34 100644 --- a/cogs/subscriptions/cog.py +++ b/cogs/subscriptions/cog.py @@ -16,6 +16,9 @@ async def autocomp_available_tags(inter: disnake.ApplicationCommandInteraction, user_input: str): + if "channel" not in inter.filled_options: + return [] + channel_id = inter.filled_options["channel"] channel: disnake.ForumChannel = await inter.bot.fetch_channel(channel_id) return [tag.name for tag in channel.available_tags if user_input in tag.name][:25]