async def is_immune(message): guild = GuildDB.get_one(message.guild.id) admins = GuildDB.get_admin_roles(guild) auth = message.author if message.guild is None: return False if auth == message.guild.owner: return True for role in auth.roles: if role.id in admins: return True
async def is_admin_check(ctx): guild = GuildDB.get_one(ctx.guild.id) admins = GuildDB.get_admin_roles(guild) auth = ctx.message.author if ctx.guild is None: return False if auth == ctx.message.guild.owner: return True for role in auth.roles: if str(role.id) in admins: return True
async def is_mod_check(ctx): guild = GuildDB.get_one(ctx.guild.id) mods = GuildDB.get_mod_roles(guild) admins = GuildDB.get_admin_roles(guild) auth = ctx.message.author if ctx.guild is None: return if auth == ctx.guild.owner: return True for role in auth.roles: if role.id in mods or role.id in admins: return True