[V3] adds a permissions check for embed_links in ctx.embed_requested (#1619)

This commit is contained in:
Michael H 2018-05-10 18:35:18 -04:00 committed by palmtree5
parent b7cd097c43
commit 1e60d1c265

View File

@ -128,12 +128,15 @@ class RedContext(commands.Context):
async def embed_requested(self): async def embed_requested(self):
""" """
Simple helper to call bot.embed_requested Simple helper to call bot.embed_requested
with logic around if embed permissions are available
Returns Returns
------- -------
bool: bool:
:code:`True` if an embed is requested :code:`True` if an embed is requested
""" """
if self.guild and not self.channel.permissions_for(self.guild.me).embed_links:
return False
return await self.bot.embed_requested( return await self.bot.embed_requested(
self.channel, self.author, command=self.command self.channel, self.author, command=self.command
) )