async def predicate(ctx): if ctx.guild.owner_id == ctx.author.id: return True default = ctx.bot.cache.states[ctx.guild.id].get_role("default") role_list = ctx.bot.cache.states[ctx.guild.id].get_perm_list for role in ctx.author.roles: if role.id in role_list: return True raise MissingRole(default)
async def predicate(ctx: Context): if await is_bot_moderator_predicate(ctx): return True if not ctx.bot.config['server_specific']: raise NotServerSpecific if any([ i for i in ctx.author.roles if i.name.casefold() in ('ssf marriagebot moderator', 'marriagebot moderator') ]): return True raise MissingRole('SSF MarriageBot Moderator')
async def predicate(self, ctx, *args, **kwargs): role_list = ctx.bot.cache.states[ctx.guild.id].banned_roles_spam for role in ctx.author.roles: if role.id in role_list: raise MissingRole(role) return await func(self, ctx, *args, **kwargs)