mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -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
|
||||
embeds = await self.bot.formatter.format_help_for(self, command)
|
||||
destination = self
|
||||
embed_wanted = await self.bot.embed_requested(
|
||||
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 = []
|
||||
for embed in embeds:
|
||||
try:
|
||||
m = await destination.send(embed=embed)
|
||||
except discord.HTTPException:
|
||||
destination = self.author
|
||||
m = await destination.send(embed=embed)
|
||||
ret.append(m)
|
||||
destination = self
|
||||
if embed_wanted:
|
||||
embeds = await self.bot.formatter.format_help_for(self, command)
|
||||
for embed in embeds:
|
||||
try:
|
||||
m = await destination.send(embed=embed)
|
||||
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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user