mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[Core] No DMing the bot (#3478)
* [Core] No DMing the bot * Return early if target user is a bot
This commit is contained in:
parent
e44fc69d14
commit
12e6f44135
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user