Skip to content

Commit

Permalink
If allow list is empty, grab is enabled everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
ajax146 committed Aug 23, 2023
1 parent ea4615f commit c203d37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions techsupport_bot/extensions/grab.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ async def invalid_channel(ctx):
This is expected to be used in a @commands.check call
"""
config = await ctx.bot.get_context_config(ctx)
# Check if list is empty. If it is, allow all channels
if not config.extensions.grab.allowed_channels.value:
return True
# If this list is not empty, it is a strict whitelist
if str(ctx.channel.id) in config.extensions.grab.allowed_channels.value:
return True
raise commands.CommandError("Grabs are disabled for this channel")
Expand Down

0 comments on commit c203d37

Please sign in to comment.