diff --git a/System/levelsystem.py b/System/levelsystem.py index 5bef893..4acae44 100644 --- a/System/levelsystem.py +++ b/System/levelsystem.py @@ -93,7 +93,7 @@ async def on_guild_join(self, guild): # get database type from config file db_type = config["Database_Type"] if db_type.lower() == "mongodb": - levelling.insert_one({"guild_id": guild.id, "main_channel": None, "admin_role": None, "roles": [], + levelling.insert_one({"guild": guild.id, "main_channel": None, "admin_role": None, "roles": [], "role_levels": [], 'talkchannels': []}) for member in guild.members: # check if member is a bot @@ -105,7 +105,7 @@ async def on_guild_join(self, guild): elif db_type.lower() == "local": db = sqlite3.connect("KumosLab/Database/Local/serverbase.sqlite") cursor = db.cursor() - sql = "INSERT INTO levelling (guild_id, admin_role, main_channel, talkchannels) VALUES (?, ?, ?, ?)" + sql = "INSERT INTO levelling (guild, admin_role, main_channel, talkchannels) VALUES (?, ?, ?, ?)" val = (guild.id, None, None, None) cursor.execute(sql, val) db.commit() @@ -130,13 +130,13 @@ async def on_guild_remove(self, guild): # get database type from config file db_type = config["Database_Type"] if db_type.lower() == "mongodb": - levelling.delete_one({"guild_id": guild.id}) + levelling.delete_one({"guild": guild.id}) for member in guild.members: levelling.delete_one({"guild_id": guild.id, "user_id": member.id}) elif db_type.lower() == "local": db = sqlite3.connect("KumosLab/Database/Local/serverbase.sqlite") cursor = db.cursor() - sql = "DELETE FROM levelling WHERE guild_id = ?" + sql = "DELETE FROM levelling WHERE guild = ?" val = (guild.id,) cursor.execute(sql, val) db.commit()