Skip to content

Commit

Permalink
[NoDMs] ignore author if it's a bot
Browse files Browse the repository at this point in the history
  • Loading branch information
japandotorg committed Jul 16, 2024
1 parent dc785d5 commit bbf6ddc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nodms/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ async def _send_response(
async def _before_invoke_hook(self, ctx: commands.Context) -> None:
await self.wait_until_cache_ready()
if (
self.cache.toggle
not ctx.author.bot
and self.cache.toggle
and self.cache.type.lower() in ["all", "commands"]
and (
ctx.channel == ctx.author.dm_channel
Expand Down Expand Up @@ -314,7 +315,8 @@ async def on_message_without_command(self, message: discord.Message):
await self.wait_until_cache_ready()
ctx: commands.Context = cast(commands.Context, await self.bot.get_context(message))
if (
self.cache.toggle
not message.author.bot
and self.cache.toggle
and self.cache.type.lower() in ["all", "messages"]
and (
message.channel == message.author.dm_channel
Expand Down

0 comments on commit bbf6ddc

Please sign in to comment.