diff --git a/helper.py b/helper.py index d575155..672d61f 100644 --- a/helper.py +++ b/helper.py @@ -113,8 +113,15 @@ class LiveChatConfig: rows = cursor.fetchall() for word, substitutes in rows: results[word] = substitutes + cursor.close() return results + def update_chat_enable_status(self): + cursor = self.conn.cursor() + cursor.execute("update live_config set value = 1 where key = 'chat_enable_status'") + self.conn.commit() + cursor.close() + class PromptQueue: def __init__(self, maxsize=0): diff --git a/liveMan.py b/liveMan.py index 2a6c6a1..875d722 100644 --- a/liveMan.py +++ b/liveMan.py @@ -381,6 +381,7 @@ class DouyinLiveWebReply: """ 优先从用户交互队列中取提示词,如果没有用户交互的数据,则输出系统提示词 """ + live_chat_config.update_chat_enable_status() while True: try: is_speaking = requests.post(f'{live_talking_host}/is_speaking', json={'sessionid': self.session_id},