Fixed not working config

This commit is contained in:
Profitroll 2023-05-06 18:31:23 +02:00
parent f9a8d6ddf6
commit 9d7a13f473

View File

@ -30,7 +30,7 @@ class Logger(commands.Cog):
@commands.Cog.listener() @commands.Cog.listener()
async def on_member_join(self, member: Member): async def on_member_join(self, member: Member):
welcome_chan = ds_utils.get(self.client.get_guild(await config_get("guild")).channels, id=await config_get("logging", "channels", "text")) welcome_chan = ds_utils.get(self.client.get_guild(await config_get("guild")).channels, id=await config_get("welcome", "channels", "text"))
rules_chan = ds_utils.get(self.client.get_guild(await config_get("guild")).channels, id=await config_get("rules", "channels", "text")) rules_chan = ds_utils.get(self.client.get_guild(await config_get("guild")).channels, id=await config_get("rules", "channels", "text"))
if (member != self.client.user) and (member.bot == False) and (member.system == False): if (member != self.client.user) and (member.bot == False) and (member.system == False):
@ -38,12 +38,12 @@ class Logger(commands.Cog):
await welcome_chan.send(content=(await config_get("welcome", "messages")).format(mention=member.mention, rules=rules_chan.mention)) await welcome_chan.send(content=(await config_get("welcome", "messages")).format(mention=member.mention, rules=rules_chan.mention))
if col_users.find_one({"user": member.id}) is None: if col_users.find_one({"user": member.id}) is None:
col_users.insert_one(document=user)
user = {} user = {}
defaults = await config_get("user", "defaults") defaults = await config_get("user", "defaults")
user["user"] = member.id user["user"] = member.id
for key in defaults: for key in defaults:
user[key] = defaults[key] user[key] = defaults[key]
col_users.insert_one(document=user)