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

@@ -375,7 +375,7 @@ class Case:
if not self.message:
return
try:
use_embed = await self.bot.embed_requested(self.message.channel, self.guild.me)
use_embed = await self.bot.embed_requested(self.message.channel)
case_content = await self.message_content(use_embed)
if use_embed:
await self.message.edit(embed=case_content)
@@ -993,7 +993,7 @@ async def create_case(
bot.dispatch("modlog_case_create", case)
try:
mod_channel = await get_modlog_channel(case.guild)
use_embeds = await case.bot.embed_requested(mod_channel, case.guild.me)
use_embeds = await case.bot.embed_requested(mod_channel)
case_content = await case.message_content(use_embeds)
if use_embeds:
msg = await mod_channel.send(embed=case_content)