Working on #14
This commit is contained in:
10
cogs/data.py
10
cogs/data.py
@@ -40,7 +40,7 @@ class Data(commands.Cog):
|
||||
|
||||
# Return if the user is not an owner and not in the council
|
||||
if (ctx.user.id not in self.client.owner_ids) and not (
|
||||
await holo_user.is_council(ctx.author)
|
||||
await HoloUser.is_council(ctx.author)
|
||||
):
|
||||
logging.info(
|
||||
"User %s tried to use /export but permission denied",
|
||||
@@ -108,11 +108,9 @@ class Data(commands.Cog):
|
||||
async def data_migrate_cmd(self, ctx: ApplicationContext, kind: str):
|
||||
await ctx.defer()
|
||||
|
||||
holo_user = HoloUser(ctx.author)
|
||||
|
||||
# Return if the user is not an owner and not in the council
|
||||
if (ctx.user.id not in self.client.owner_ids) and not (
|
||||
await holo_user.is_council(ctx.author)
|
||||
await HoloUser.is_council(ctx.author)
|
||||
):
|
||||
logging.info(
|
||||
"User %s tried to use /migrate but permission denied",
|
||||
@@ -156,7 +154,7 @@ class Data(commands.Cog):
|
||||
if member.bot:
|
||||
continue
|
||||
|
||||
if col_users.find_one({"user": member.id}) is None:
|
||||
if (await col_users.find_one({"user": member.id})) is None:
|
||||
user = {}
|
||||
defaults = await config_get("user", "defaults")
|
||||
|
||||
@@ -165,7 +163,7 @@ class Data(commands.Cog):
|
||||
for key in defaults:
|
||||
user[key] = defaults[key]
|
||||
|
||||
col_users.insert_one(document=user)
|
||||
await col_users.insert_one(document=user)
|
||||
|
||||
logging.info(
|
||||
"Added DB record for user %s during migration", member.id
|
||||
|
Reference in New Issue
Block a user