From 0491b734c0747fe1029dbd523e5befd1bfea6886 Mon Sep 17 00:00:00 2001 From: dkay Date: Sun, 19 Apr 2026 01:29:08 -0700 Subject: [PATCH 1/5] Check thread/forum channels for restricted factoids --- techsupport_bot/commands/factoids.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/techsupport_bot/commands/factoids.py b/techsupport_bot/commands/factoids.py index 5490f7f6..0b324d47 100644 --- a/techsupport_bot/commands/factoids.py +++ b/techsupport_bot/commands/factoids.py @@ -27,13 +27,14 @@ import discord import expiringdict import munch -import ui import yaml from aiohttp.client_exceptions import InvalidURL -from botlogging import LogContext, LogLevel -from core import auxiliary, cogs, custom_errors, extensionconfig from discord import app_commands from discord.ext import commands + +import ui +from botlogging import LogContext, LogLevel +from core import auxiliary, cogs, custom_errors, extensionconfig from functions import logger as function_logger if TYPE_CHECKING: @@ -831,12 +832,18 @@ async def response( if factoid.disabled: return - if ( - factoid.restricted - and str(ctx.channel.id) - not in config.extensions.factoids.restricted_list.value - ): - return + if factoid.restricted: + channel = ctx.channel + restricted_list = config.extensions.factoids.restricted_list.value + if isinstance(channel, discord.Thread): + if ( + str(channel.id) not in restricted_list + and str(channel.parent.id) not in restricted_list + ): + return + else: + if str(channel.id) not in restricted_list: + return if config.extensions.factoids.disable_embeds.value: embed = None From bca516e3f1042ec8644d5271e1410e7d0f24622f Mon Sep 17 00:00:00 2001 From: dkay Date: Sun, 19 Apr 2026 01:37:21 -0700 Subject: [PATCH 2/5] Fix formatting --- techsupport_bot/commands/animal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/techsupport_bot/commands/animal.py b/techsupport_bot/commands/animal.py index 9062b583..2a973a28 100644 --- a/techsupport_bot/commands/animal.py +++ b/techsupport_bot/commands/animal.py @@ -4,9 +4,10 @@ from typing import TYPE_CHECKING, Self -from core import auxiliary, cogs from discord.ext import commands +from core import auxiliary, cogs + if TYPE_CHECKING: import bot From 2daaba89f91c4818aa98ad39269d21e1300c04a2 Mon Sep 17 00:00:00 2001 From: dkay Date: Sun, 19 Apr 2026 02:50:14 -0700 Subject: [PATCH 3/5] Remove random animal change --- techsupport_bot/commands/animal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/techsupport_bot/commands/animal.py b/techsupport_bot/commands/animal.py index 2a973a28..d6dcbb3f 100644 --- a/techsupport_bot/commands/animal.py +++ b/techsupport_bot/commands/animal.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING, Self +from core import auxiliary, cogs from discord.ext import commands -from core import auxiliary, cogs if TYPE_CHECKING: import bot From ba1f623ce1aa17dd6eeef4e06447f54d209ef2fa Mon Sep 17 00:00:00 2001 From: dkay Date: Sun, 19 Apr 2026 02:51:22 -0700 Subject: [PATCH 4/5] Update animal.py --- techsupport_bot/commands/animal.py | 1 - 1 file changed, 1 deletion(-) diff --git a/techsupport_bot/commands/animal.py b/techsupport_bot/commands/animal.py index d6dcbb3f..9062b583 100644 --- a/techsupport_bot/commands/animal.py +++ b/techsupport_bot/commands/animal.py @@ -7,7 +7,6 @@ from core import auxiliary, cogs from discord.ext import commands - if TYPE_CHECKING: import bot From 55c25f16cc6a74386357bcd58d7cba07b709a5db Mon Sep 17 00:00:00 2001 From: dkay Date: Sun, 19 Apr 2026 11:39:23 -0700 Subject: [PATCH 5/5] undo isort --- techsupport_bot/commands/factoids.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/techsupport_bot/commands/factoids.py b/techsupport_bot/commands/factoids.py index 0b324d47..1673d421 100644 --- a/techsupport_bot/commands/factoids.py +++ b/techsupport_bot/commands/factoids.py @@ -27,14 +27,13 @@ import discord import expiringdict import munch +import ui import yaml from aiohttp.client_exceptions import InvalidURL -from discord import app_commands -from discord.ext import commands - -import ui from botlogging import LogContext, LogLevel from core import auxiliary, cogs, custom_errors, extensionconfig +from discord import app_commands +from discord.ext import commands from functions import logger as function_logger if TYPE_CHECKING: