Working on #14

This commit is contained in:
kku
2024-12-16 16:25:35 +01:00
parent 41112018da
commit 454ce2b6fb
7 changed files with 62 additions and 50 deletions

View File

@@ -18,7 +18,7 @@ class Logger(commands.Cog):
and (message.author.bot is False)
and (message.author.system is False)
):
if col_users.find_one({"user": message.author.id}) is None:
if (await col_users.find_one({"user": message.author.id})) is None:
user = {}
defaults = await config_get("user", "defaults")
@@ -27,7 +27,7 @@ class Logger(commands.Cog):
for key in defaults:
user[key] = defaults[key]
col_users.insert_one(document=user)
await col_users.insert_one(document=user)
@commands.Cog.listener()
async def on_member_join(self, member: Member):
@@ -51,7 +51,7 @@ class Logger(commands.Cog):
)
)
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")
@@ -60,7 +60,7 @@ class Logger(commands.Cog):
for key in defaults:
user[key] = defaults[key]
col_users.insert_one(document=user)
await col_users.insert_one(document=user)
def setup(client: PycordBot):