[Audio] Check required permissions in events (#4960)

This commit is contained in:
PredaaA
2021-05-18 22:30:26 +02:00
committed by GitHub
parent e467833cee
commit 9986cbe6b5
4 changed files with 21 additions and 12 deletions

View File

@@ -100,6 +100,10 @@ class MiscellaneousUtilities(MixinMeta, metaclass=CompositeMetaClass):
embed.set_author(name=name)
return await ctx.send(embed=embed)
def _has_notify_perms(self, channel: discord.TextChannel) -> bool:
perms = channel.permissions_for(channel.guild.me)
return all((perms.send_messages, perms.embed_links))
async def maybe_run_pending_db_tasks(self, ctx: commands.Context) -> None:
if self.api_interface is not None:
await self.api_interface.run_tasks(ctx)