mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 02:37:57 -05:00
Discord.py dep update 3.1 (#2587)
* Dependency update discord.py==1.0.1 websockets<7 [style] black==19.3b0 [Docs] jinja==2.10.1 urllib3==1.24.2 Changes related to breaking changes from discord.py have also been made to match As of this commit, help formatter is back to discord.py's default
This commit is contained in:
@@ -63,44 +63,9 @@ class Context(commands.Context):
|
||||
return await super().send(content=content, **kwargs)
|
||||
|
||||
async def send_help(self) -> List[discord.Message]:
|
||||
"""Send the command help message.
|
||||
|
||||
Returns
|
||||
-------
|
||||
`list` of `discord.Message`
|
||||
A list of help messages which were sent to the user.
|
||||
|
||||
"""
|
||||
""" Send the command help message. """
|
||||
command = self.invoked_subcommand or self.command
|
||||
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 = []
|
||||
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
|
||||
await super().send_help(command)
|
||||
|
||||
async def tick(self) -> bool:
|
||||
"""Add a tick reaction to the command message.
|
||||
|
||||
Reference in New Issue
Block a user