From 7707fec199d00dac5b2bf59c8a0d051530d10ba7 Mon Sep 17 00:00:00 2001 From: Douglas Date: Mon, 17 Aug 2020 10:22:38 -0300 Subject: [PATCH] Don't send message about DMing ACL when command's called from DM (#4188) * Only send a message telling the user the file will be send via DM if the original message didn't come from a DM * Remove unused import for AsyncIter * Changed channel instance comparison to discord.DMChannel Co-authored-by: douglas-cpp --- redbot/cogs/permissions/permissions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redbot/cogs/permissions/permissions.py b/redbot/cogs/permissions/permissions.py index b93c3ff9e..a8a6360e5 100644 --- a/redbot/cogs/permissions/permissions.py +++ b/redbot/cogs/permissions/permissions.py @@ -282,7 +282,8 @@ class Permissions(commands.Cog): except discord.Forbidden: await ctx.send(_("I'm not allowed to DM you.")) else: - await ctx.send(_("I've just sent the file to you via DM.")) + if not isinstance(ctx.channel, discord.DMChannel): + await ctx.send(_("I've just sent the file to you via DM.")) finally: file.close()