mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-08 10:22:31 -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:
@@ -231,17 +231,20 @@ class Context(DPYContext):
|
||||
|
||||
async def embed_requested(self):
|
||||
"""
|
||||
Simple helper to call bot.embed_requested
|
||||
with logic around if embed permissions are available
|
||||
Short-hand for calling bot.embed_requested with permission checks.
|
||||
|
||||
Equivalent to:
|
||||
|
||||
.. code:: python
|
||||
|
||||
await ctx.bot.embed_requested(ctx)
|
||||
|
||||
Returns
|
||||
-------
|
||||
bool:
|
||||
:code:`True` if an embed is requested
|
||||
"""
|
||||
return await self.bot.embed_requested(
|
||||
self.channel, self.author, command=self.command, check_permissions=True
|
||||
)
|
||||
return await self.bot.embed_requested(self)
|
||||
|
||||
async def maybe_send_embed(self, message: str) -> discord.Message:
|
||||
"""
|
||||
|
||||
@@ -721,9 +721,7 @@ class RedHelpFormatter(HelpFormatterABC):
|
||||
yield obj
|
||||
|
||||
async def embed_requested(self, ctx: Context) -> bool:
|
||||
return await ctx.bot.embed_requested(
|
||||
channel=ctx.channel, user=ctx.author, command=red_help, check_permissions=True
|
||||
)
|
||||
return await ctx.bot.embed_requested(channel=ctx.channel, command=red_help)
|
||||
|
||||
async def command_not_found(self, ctx, help_for, help_settings: HelpSettings):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user