mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot
synced 2024-12-23 05:53:32 +02:00
add more debug info
This commit is contained in:
parent
099285c147
commit
5eb9de930d
1 changed files with 2 additions and 0 deletions
|
@ -15,6 +15,7 @@ conn.commit()
|
|||
|
||||
def add_state(key, value):
|
||||
'''Создание стейта, если существует - будет заменен'''
|
||||
logger.debug(f'Adding {key}: {value}')
|
||||
c.execute("INSERT OR REPLACE INTO states(key, value) VALUES (?, ?)", (key, value))
|
||||
conn.commit()
|
||||
logger.warning(f'Добавлен стейт {key}: {value}')
|
||||
|
@ -22,6 +23,7 @@ def add_state(key, value):
|
|||
|
||||
def get_state(key):
|
||||
'''Получение стейта по ключу'''
|
||||
logger.debug(f'Запрошен стейт {key}')
|
||||
value = c.execute("SELECT value FROM states WHERE key = (?)", (key,)).fetchone()
|
||||
if value:
|
||||
return value[0]
|
||||
|
|
Loading…
Reference in a new issue