|
|
|
@ -6,8 +6,8 @@ owner_id = 351794468870946827
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def check_admin_role(bot, ctx, member):
|
|
|
|
async def check_admin_role(bot, ctx, member):
|
|
|
|
admin_roles = json.loads(await bot.db_concon.fetchval(f"select admin_roles from guild_config where guild_id = $1",
|
|
|
|
admin_roles = json.loads(await bot.db_con.fetchval(f"select admin_roles from guild_config where guild_id = $1",
|
|
|
|
ctx.guild.id))
|
|
|
|
ctx.guild.id))
|
|
|
|
for role in admin_roles:
|
|
|
|
for role in admin_roles:
|
|
|
|
if discord.utils.get(ctx.guild.roles, id=admin_roles[role]) in member.roles:
|
|
|
|
if discord.utils.get(ctx.guild.roles, id=admin_roles[role]) in member.roles:
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
@ -15,8 +15,8 @@ async def check_admin_role(bot, ctx, member):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def check_rcon_role(bot, ctx, member):
|
|
|
|
async def check_rcon_role(bot, ctx, member):
|
|
|
|
rcon_admin_roles = json.loads(await bot.db_concon.fetchval("select rcon_admin_roles from guild_config "
|
|
|
|
rcon_admin_roles = json.loads(await bot.db_con.fetchval("select rcon_admin_roles from guild_config "
|
|
|
|
"where guild_id = $1", ctx.guild.id))
|
|
|
|
"where guild_id = $1", ctx.guild.id))
|
|
|
|
for role in rcon_admin_roles:
|
|
|
|
for role in rcon_admin_roles:
|
|
|
|
if discord.utils.get(ctx.guild.roles, id=rcon_admin_roles[role]) in member.roles:
|
|
|
|
if discord.utils.get(ctx.guild.roles, id=rcon_admin_roles[role]) in member.roles:
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
@ -24,8 +24,8 @@ async def check_rcon_role(bot, ctx, member):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def is_admin(bot, ctx):
|
|
|
|
async def is_admin(bot, ctx):
|
|
|
|
admin_roles = json.loads(await bot.db_concon.fetchval("select admin_roles from guild_config where guild_id = $1",
|
|
|
|
admin_roles = json.loads(await bot.db_con.fetchval("select admin_roles from guild_config where guild_id = $1",
|
|
|
|
ctx.guild.id))
|
|
|
|
ctx.guild.id))
|
|
|
|
for role in admin_roles:
|
|
|
|
for role in admin_roles:
|
|
|
|
if discord.utils.get(ctx.guild.roles, id=admin_roles[role]) in ctx.message.author.roles:
|
|
|
|
if discord.utils.get(ctx.guild.roles, id=admin_roles[role]) in ctx.message.author.roles:
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
@ -39,8 +39,8 @@ async def is_guild_owner(ctx):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def is_rcon_admin(bot, ctx):
|
|
|
|
async def is_rcon_admin(bot, ctx):
|
|
|
|
rcon_admin_roles = json.loads(await bot.db_concon.fetchval("select rcon_admin_roles from guild_config "
|
|
|
|
rcon_admin_roles = json.loads(await bot.db_con.fetchval("select rcon_admin_roles from guild_config "
|
|
|
|
"where guild_id = $1", ctx.guild.id))
|
|
|
|
"where guild_id = $1", ctx.guild.id))
|
|
|
|
for role in rcon_admin_roles:
|
|
|
|
for role in rcon_admin_roles:
|
|
|
|
if discord.utils.get(ctx.guild.roles, id=rcon_admin_roles[role]) in ctx.message.author.roles:
|
|
|
|
if discord.utils.get(ctx.guild.roles, id=rcon_admin_roles[role]) in ctx.message.author.roles:
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|