mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 01:42:30 -05:00
[Core] Replaced JsonDB with Config (#770)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
|
||||
@@ -23,8 +24,12 @@ def mod_or_permissions(**perms):
|
||||
if ctx.guild is None:
|
||||
return has_perms_or_is_owner
|
||||
author = ctx.author
|
||||
mod_role = ctx.bot.db.get_mod_role(ctx.guild)
|
||||
admin_role = ctx.bot.db.get_admin_role(ctx.guild)
|
||||
mod_role_id = ctx.bot.db.guild(ctx.guild).mod_role()
|
||||
admin_role_id = ctx.bot.db.guild(ctx.guild).admin_role()
|
||||
|
||||
mod_role = discord.utils.get(ctx.guild.roles, id=mod_role_id)
|
||||
admin_role = discord.utils.get(ctx.guild.roles, id=admin_role_id)
|
||||
|
||||
is_staff = mod_role in author.roles or admin_role in author.roles
|
||||
is_guild_owner = author == ctx.guild.owner
|
||||
|
||||
@@ -40,7 +45,7 @@ def admin_or_permissions(**perms):
|
||||
return has_perms_or_is_owner
|
||||
author = ctx.author
|
||||
is_guild_owner = author == ctx.guild.owner
|
||||
admin_role = ctx.bot.db.get_admin_role(ctx.guild)
|
||||
admin_role = ctx.bot.db.guild(ctx.guild).admin_role()
|
||||
|
||||
return admin_role in author.roles or has_perms_or_is_owner or is_guild_owner
|
||||
|
||||
|
||||
Reference in New Issue
Block a user