From 12e6f4413526302b6e9967ee62262970144e263b Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Mon, 3 Feb 2020 13:26:33 -0800 Subject: [PATCH] [Core] No DMing the bot (#3478) * [Core] No DMing the bot * Return early if target user is a bot --- redbot/core/core_commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index f17ab6cce..dd9b8f939 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1581,12 +1581,12 @@ class Core(commands.Cog, CoreLogic): settings, 'appearance' tab. Then right click a user and copy their id""" destination = discord.utils.get(ctx.bot.get_all_members(), id=user_id) - if destination is None: + if destination is None or destination.bot: await ctx.send( _( - "Invalid ID or user not found. You can only " - "send messages to people I share a server " - "with." + "Invalid ID, user not found, or user is a bot. " + "You can only send messages to people I share " + "a server with." ) ) return