mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[V3 Context] make send_help respect embed setting (#1723)
This commit is contained in:
parent
971ccf9df4
commit
179883094e
@ -30,16 +30,33 @@ class Context(commands.Context):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
command = self.invoked_subcommand or self.command
|
command = self.invoked_subcommand or self.command
|
||||||
embeds = await self.bot.formatter.format_help_for(self, command)
|
embed_wanted = await self.bot.embed_requested(
|
||||||
destination = self
|
self.channel, self.author, command=self.bot.get_command("help")
|
||||||
|
)
|
||||||
|
if self.guild and not self.channel.permissions_for(self.guild.me).embed_links:
|
||||||
|
embed_wanted = False
|
||||||
|
|
||||||
ret = []
|
ret = []
|
||||||
for embed in embeds:
|
destination = self
|
||||||
try:
|
if embed_wanted:
|
||||||
m = await destination.send(embed=embed)
|
embeds = await self.bot.formatter.format_help_for(self, command)
|
||||||
except discord.HTTPException:
|
for embed in embeds:
|
||||||
destination = self.author
|
try:
|
||||||
m = await destination.send(embed=embed)
|
m = await destination.send(embed=embed)
|
||||||
ret.append(m)
|
except discord.HTTPException:
|
||||||
|
destination = self.author
|
||||||
|
m = await destination.send(embed=embed)
|
||||||
|
ret.append(m)
|
||||||
|
else:
|
||||||
|
f = commands.HelpFormatter()
|
||||||
|
msgs = await f.format_help_for(self, command)
|
||||||
|
for msg in msgs:
|
||||||
|
try:
|
||||||
|
m = await destination.send(msg)
|
||||||
|
except discord.HTTPException:
|
||||||
|
destination = self.author
|
||||||
|
m = await destination.send(msg)
|
||||||
|
ret.append(m)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user