mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 01:12:33 -05:00
Support all Messageables in bot.embed_requested() (#5576)
* Support all Messageables in bot.embed_requested * Update usage in core * Simplify [p]contact This couldn't be done before this change. I have also simplified getting embed color. * Make `True` the new default for `check_permissions` kwarg
This commit is contained in:
@@ -3975,31 +3975,12 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
successful = False
|
||||
|
||||
for destination in destinations:
|
||||
|
||||
is_dm = isinstance(destination, discord.User)
|
||||
send_embed = None
|
||||
if not is_dm and not destination.permissions_for(destination.guild.me).send_messages:
|
||||
continue
|
||||
|
||||
if is_dm:
|
||||
send_embed = await ctx.bot._config.user(destination).embeds()
|
||||
else:
|
||||
if not destination.permissions_for(destination.guild.me).send_messages:
|
||||
continue
|
||||
if destination.permissions_for(destination.guild.me).embed_links:
|
||||
send_embed = await ctx.bot._config.channel(destination).embeds()
|
||||
if send_embed is None:
|
||||
send_embed = await ctx.bot._config.guild(destination.guild).embeds()
|
||||
else:
|
||||
send_embed = False
|
||||
|
||||
if send_embed is None:
|
||||
send_embed = await ctx.bot._config.embeds()
|
||||
|
||||
if send_embed:
|
||||
|
||||
if not is_dm:
|
||||
color = await ctx.bot.get_embed_color(destination)
|
||||
else:
|
||||
color = ctx.bot._color
|
||||
if await ctx.bot.embed_requested(destination, command=ctx.command):
|
||||
color = await ctx.bot.get_embed_color(destination)
|
||||
|
||||
e = discord.Embed(colour=color, description=message)
|
||||
if author.avatar_url:
|
||||
|
||||
Reference in New Issue
Block a user