it's version 0.8 Добавлена возможность выключения хранения логов и баз данных
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
from .DB import get_db
|
||||
from config import Config
|
||||
|
||||
|
||||
def save_message(chat_id: int, message_id: int):
|
||||
if Config.DISABLE_STORAGE:
|
||||
return
|
||||
from .DB import get_db
|
||||
|
||||
db = get_db()
|
||||
cur = db.cursor()
|
||||
cur.execute("INSERT INTO message VALUES (?, ?)", (int(chat_id), int(message_id)))
|
||||
@@ -11,6 +15,10 @@ def save_message(chat_id: int, message_id: int):
|
||||
|
||||
|
||||
def load_messages():
|
||||
if Config.DISABLE_STORAGE:
|
||||
return []
|
||||
from .DB import get_db
|
||||
|
||||
db = get_db()
|
||||
cur = db.cursor()
|
||||
cur.execute("SELECT * FROM message")
|
||||
@@ -21,6 +29,10 @@ def load_messages():
|
||||
|
||||
|
||||
def clear_messages():
|
||||
if Config.DISABLE_STORAGE:
|
||||
return
|
||||
from .DB import get_db
|
||||
|
||||
db = get_db()
|
||||
cur = db.cursor()
|
||||
cur.execute("DELETE FROM message")
|
||||
|
||||
Reference in New Issue
Block a user