From 306de3a64c198c89d8b4cda458ad5800ea9d722e 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redbot/cogs/permissions/permissions.py b/redbot/cogs/permissions/permissions.py index 68a5bd95d..6e386bcf5 100644 --- a/redbot/cogs/permissions/permissions.py +++ b/redbot/cogs/permissions/permissions.py @@ -10,7 +10,6 @@ from schema import And, Or, Schema, SchemaError, Optional as UseOptional from redbot.core import checks, commands, config from redbot.core.bot import Red from redbot.core.i18n import Translator, cog_i18n -from redbot.core.utils import AsyncIter from redbot.core.utils.chat_formatting import box from redbot.core.utils.menus import start_adding_reactions from redbot.core.utils.predicates import ReactionPredicate, MessagePredicate @@ -333,7 +332,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()