mirror of
https://github.com/zhinianboke/xianyu-auto-reply.git
synced 2025-08-30 01:27:35 +08:00
修复指定商品回复
修复指定商品回复
This commit is contained in:
commit
3cb37a8240
@ -1245,12 +1245,18 @@ class XianyuLive:
|
|||||||
|
|
||||||
# 进行变量替换
|
# 进行变量替换
|
||||||
try:
|
try:
|
||||||
|
# 获取当前商品是否有设置自动回复
|
||||||
|
item_replay = db_manager.get_item_replay(item_id)
|
||||||
|
|
||||||
formatted_reply = reply_content.format(
|
formatted_reply = reply_content.format(
|
||||||
send_user_name=send_user_name,
|
send_user_name=send_user_name,
|
||||||
send_user_id=send_user_id,
|
send_user_id=send_user_id,
|
||||||
send_message=send_message
|
send_message=send_message
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if item_replay:
|
||||||
|
formatted_reply = item_replay.get('reply_content', '')
|
||||||
|
|
||||||
# 如果开启了"只回复一次"功能,记录这次回复
|
# 如果开启了"只回复一次"功能,记录这次回复
|
||||||
if default_reply_settings.get('reply_once', False) and chat_id:
|
if default_reply_settings.get('reply_once', False) and chat_id:
|
||||||
db_manager.add_default_reply_record(self.cookie_id, chat_id)
|
db_manager.add_default_reply_record(self.cookie_id, chat_id)
|
||||||
|
@ -318,12 +318,12 @@ class DBManager:
|
|||||||
# 创建指定商品回复表
|
# 创建指定商品回复表
|
||||||
cursor.execute('''
|
cursor.execute('''
|
||||||
CREATE TABLE IF NOT EXISTS item_replay (
|
CREATE TABLE IF NOT EXISTS item_replay (
|
||||||
item_id TEXT NOT NULL PRIMARY KEY,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
item_id TEXT NOT NULL,
|
||||||
cookie_id TEXT NOT NULL,
|
cookie_id TEXT NOT NULL,
|
||||||
reply_content TEXT NOT NULL ,
|
reply_content TEXT NOT NULL ,
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
FOREIGN KEY (item_id) REFERENCES cookies(id) ON DELETE CASCADE
|
|
||||||
)
|
)
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
@ -3952,7 +3952,7 @@ def delete_table_record(table_name: str, record_id: str, admin_user: Dict[str, A
|
|||||||
'users', 'cookies', 'cookie_status', 'keywords', 'default_replies', 'default_reply_records',
|
'users', 'cookies', 'cookie_status', 'keywords', 'default_replies', 'default_reply_records',
|
||||||
'ai_reply_settings', 'ai_conversations', 'ai_item_cache', 'item_info',
|
'ai_reply_settings', 'ai_conversations', 'ai_item_cache', 'item_info',
|
||||||
'message_notifications', 'cards', 'delivery_rules', 'notification_channels',
|
'message_notifications', 'cards', 'delivery_rules', 'notification_channels',
|
||||||
'user_settings', 'system_settings', 'email_verifications', 'captcha_codes', 'orders'
|
'user_settings', 'system_settings', 'email_verifications', 'captcha_codes', 'orders','item_replay'
|
||||||
]
|
]
|
||||||
|
|
||||||
if table_name not in allowed_tables:
|
if table_name not in allowed_tables:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user