all type message can process
This commit is contained in:
@@ -5,10 +5,6 @@ from datetime import datetime
|
||||
from logs.custom_logger import logger
|
||||
|
||||
|
||||
# Получение абсолютного пути к текущей директории
|
||||
# current_dir = os.getcwd()
|
||||
|
||||
|
||||
class BotDB:
|
||||
def __init__(self, current_dir, name):
|
||||
self.db_file = os.path.join(current_dir, name)
|
||||
@@ -828,7 +824,7 @@ class BotDB:
|
||||
try:
|
||||
self.connect()
|
||||
result = self.cursor.execute("""
|
||||
SELECT cpft.content_name
|
||||
SELECT cpft.content_name, cpft.content_type
|
||||
FROM post_from_telegram_suggest pft
|
||||
JOIN message_link_to_content mltc
|
||||
ON pft.message_id = mltc.post_id
|
||||
@@ -878,10 +874,10 @@ class BotDB:
|
||||
except Exception as e:
|
||||
self.logger.error(f"Ошибка в функции get_post_text_from_telegram_by_last_id {str(e)}")
|
||||
|
||||
def add_post_content_in_db(self, post_id: int, message_id: int, content_name: str):
|
||||
def add_post_content_in_db(self, post_id: int, message_id: int, content_name: str, type_content: str):
|
||||
self.logger.info(
|
||||
f"Запуск функции add_post_content_in_db: post_id={post_id}, message_id={message_id}, "
|
||||
f"content_name={content_name}")
|
||||
f"content_name={content_name}, content_type={type_content}")
|
||||
try:
|
||||
self.connect()
|
||||
self.cursor.execute(
|
||||
@@ -889,8 +885,8 @@ class BotDB:
|
||||
"VALUES (?, ?)", (post_id, message_id))
|
||||
self.conn.commit()
|
||||
self.cursor.execute(
|
||||
"INSERT INTO content_post_from_telegram (message_id, content_name)"
|
||||
"VALUES (?, ?)", (message_id, content_name))
|
||||
"INSERT INTO content_post_from_telegram (message_id, content_name, content_type)"
|
||||
"VALUES (?, ?, ?)", (message_id, content_name, type_content))
|
||||
self.conn.commit()
|
||||
self.logger.info(f"Функция add_post_content_in_db отработала успешно")
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user