Skip to content

Commit

Permalink
[NoDMs] check for isinstance instead
Browse files Browse the repository at this point in the history
  • Loading branch information
japandotorg committed Jul 17, 2024
1 parent 3ea973e commit 9164737
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nodms/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ async def _before_invoke_hook(self, ctx: commands.Context) -> None:
if (
self.cache.toggle
and self.cache.type.lower() in ["all", "commands"]
and ctx.channel == ctx.author.dm_channel
and isinstance(ctx.channel, discord.DMChannel)
and not await cast(Red, ctx.bot).is_owner(ctx.author)
and not isinstance(ctx.command, commands.commands._AlwaysAvailableMixin)
):
Expand Down Expand Up @@ -313,7 +313,7 @@ async def on_message_without_command(self, message: discord.Message):
if (
self.cache.toggle
and self.cache.type.lower() in ["all", "messages"]
and message.channel == message.author.dm_channel
and isinstance(message.channel, discord.DMChannel)
and not await cast(Red, ctx.bot).is_owner(message.author)
):
if ctx.command:
Expand Down

0 comments on commit 9164737

Please sign in to comment.