From 565d0f2956beb4daa9c16362bc242c8ecca0e7be Mon Sep 17 00:00:00 2001 From: Paillat Date: Fri, 5 May 2023 13:47:37 +0200 Subject: [PATCH] refactor(makeprompt.py): rename variables for clarity and remove unnecessary pass statement --- code/makeprompt.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/makeprompt.py b/code/makeprompt.py index 9afc6fb..e66d97c 100644 --- a/code/makeprompt.py +++ b/code/makeprompt.py @@ -74,7 +74,6 @@ def get_guild_data(message): except Exception as e: premium = 0 raise e - pass try: curs_data.execute( "SELECT * FROM images WHERE guild_id = ?", (mg_to_guid(message),) @@ -243,15 +242,15 @@ async def chat_process(self, message): channels = [] try: - con_premium.execute( + curs_premium.execute( "SELECT * FROM channels WHERE guild_id = ?", (mg_to_guid(message),) ) - images_data = curs_premium.fetchone() + channels_data = curs_premium.fetchone() if guild_data["premium"]: # for 5 times, we get c.fetchone()[1] to c.fetchone()[5] and we add it to the channels list, each time with try except for i in range(1, 6): # we use the i variable to get the channel id try: - channels.append(str(images_data[i])) + channels.append(str(channels_data[i])) except: pass except: