Changed admin check

This commit is contained in:
2023-05-08 15:45:00 +02:00
parent 35ee903abb
commit 786bc95eeb
3 changed files with 50 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ from discord import ApplicationContext, Embed, File, option
from discord import utils as ds_utils
from discord.commands import SlashCommandGroup
from discord.ext import commands
from classes.holo_user import HoloUser
from enums.colors import Color
from modules.database import col_users
@@ -32,7 +33,10 @@ class Data(commands.Cog):
)
async def data_export_cmd(self, ctx: ApplicationContext, kind: str):
await ctx.defer()
if ctx.user.id in await config_get("admins"):
holo_user = HoloUser(ctx.author)
if (ctx.user.id in await config_get("admins")) or (
await holo_user.is_council(ctx.author)
):
logging.info(
f"Moderator {guild_name(ctx.user)} exported current users list"
)
@@ -94,7 +98,10 @@ class Data(commands.Cog):
)
async def data_migrate_cmd(self, ctx: ApplicationContext, kind: str):
await ctx.defer()
if ctx.user.id in await config_get("admins"):
holo_user = HoloUser(ctx.author)
if (ctx.user.id in await config_get("admins")) or (
await holo_user.is_council(ctx.author)
):
logging.info(
f"Moderator {guild_name(ctx.user)} started migration of all members to the database"
)