mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
* Fix cleanup self not working in private. This fix #4408. * Apply Jack's logic. * Obviously Black fault. AGAIN! * Apply Jack's trick. * This is not a converter so let's move this to a different file Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
16 lines
478 B
Python
16 lines
478 B
Python
from redbot.core.commands import Context, permissions_check
|
|
from redbot.core.utils.mod import is_mod_or_superior, check_permissions
|
|
|
|
|
|
def check_self_permissions():
|
|
async def predicate(ctx: Context):
|
|
if not ctx.guild:
|
|
return True
|
|
if await check_permissions(ctx, {"manage_messages": True}) or await is_mod_or_superior(
|
|
ctx.bot, ctx.author
|
|
):
|
|
return True
|
|
return False
|
|
|
|
return permissions_check(predicate)
|