[Core] No DMing the bot (#3478)

* [Core] No DMing the bot

* Return early if target user is a bot
This commit is contained in:
aikaterna 2020-02-03 13:26:33 -08:00 committed by GitHub
parent e44fc69d14
commit 12e6f44135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1581,12 +1581,12 @@ class Core(commands.Cog, CoreLogic):
settings, 'appearance' tab. Then right click a user settings, 'appearance' tab. Then right click a user
and copy their id""" and copy their id"""
destination = discord.utils.get(ctx.bot.get_all_members(), id=user_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( await ctx.send(
_( _(
"Invalid ID or user not found. You can only " "Invalid ID, user not found, or user is a bot. "
"send messages to people I share a server " "You can only send messages to people I share "
"with." "a server with."
) )
) )
return return