Fix bug that stopped disabling from working

This commit is contained in:
Dan Hess 2020-11-21 17:52:19 -06:00
parent 05e2b10c8e
commit d47718ea3b
1 changed files with 4 additions and 1 deletions

View File

@ -30,7 +30,7 @@ async def check_not_restricted(ctx):
# Get the source and destination
# Source should ALWAYS be a command in this case
source = from_restriction.get("source")
destination = int(from_restriction.get("destination"))
destination = from_restriction.get("destination")
# Special check for what the "disable" command produces
if destination == "everyone" and ctx.command.qualified_name == source:
return False
@ -38,6 +38,9 @@ async def check_not_restricted(ctx):
if source != ctx.command.qualified_name:
continue
# If the destination isn't everyone, then it's an integer
destination = int(destination)
# This means that the type of restriction we have is `command from channel`
# Which means we do not want commands to be ran in this channel
if destination == ctx.channel.id: