File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727import discord
2828import expiringdict
2929import munch
30- import ui
3130import yaml
3231from aiohttp .client_exceptions import InvalidURL
33- from botlogging import LogContext , LogLevel
34- from core import auxiliary , cogs , custom_errors , extensionconfig
3532from discord import app_commands
3633from discord .ext import commands
34+
35+ import ui
36+ from botlogging import LogContext , LogLevel
37+ from core import auxiliary , cogs , custom_errors , extensionconfig
3738from functions import logger as function_logger
3839
3940if TYPE_CHECKING :
@@ -831,12 +832,18 @@ async def response(
831832 if factoid .disabled :
832833 return
833834
834- if (
835- factoid .restricted
836- and str (ctx .channel .id )
837- not in config .extensions .factoids .restricted_list .value
838- ):
839- return
835+ if factoid .restricted :
836+ channel = ctx .channel
837+ restricted_list = config .extensions .factoids .restricted_list .value
838+ if isinstance (channel , discord .Thread ):
839+ if (
840+ str (channel .id ) not in restricted_list
841+ and str (channel .parent .id ) not in restricted_list
842+ ):
843+ return
844+ else :
845+ if str (channel .id ) not in restricted_list :
846+ return
840847
841848 if config .extensions .factoids .disable_embeds .value :
842849 embed = None
You can’t perform that action at this time.
0 commit comments