@ -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()
class PromptQueue:
def __init__(self, maxsize=0):
@ -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},