From c4057a35255f416b4f9f200c957893cde4be223a Mon Sep 17 00:00:00 2001 From: ssleg <1537206@mail.ru> Date: Thu, 23 Dec 2021 09:49:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5.=20=D0=98=D0=BD=D0=B4=D0=B5=D0=BA=D1=81?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BF=D0=BE=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8E=20user=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat_reader.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chat_reader.py b/chat_reader.py index 3d28e3d..acc565c 100755 --- a/chat_reader.py +++ b/chat_reader.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 -# Telegram chat reader v1.01 -# 22/12/2021 +# Telegram chat reader v1.02 +# 23/12/2021 # https://t.me/ssleg © 2021 @@ -184,7 +184,6 @@ def check_config(): password=database_pass, host=database_host, port=database_port) - valid_db = True cursor = con.cursor() cursor.execute(''' create table if not exists chat_reader_users @@ -237,9 +236,12 @@ def check_config(): constraint chat_reader_pk primary key (chat_id, message_id) ); + + create index if not exists chat_reader_mess_user_id on chat_reader_mess (user_id); ''') con.commit() con.close() + valid_db = True except Exception as e: print(e) @@ -249,8 +251,8 @@ def check_config(): client = TelegramClient('chat_reader', api_id, api_hash) client.start() print(f'версия telethon {client.__version__}') - valid_client = True client.disconnect() + valid_client = True except Exception as e: print(e)