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:
jack1142
2022-03-21 17:22:55 +01:00
committed by GitHub
parent f763d29fd4
commit 0f299ae195
7 changed files with 38 additions and 51 deletions

View File

@@ -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:
"""