mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-10 15:56:03 +00:00
fix: !list时会显示预设消息 #48
This commit is contained in:
@@ -198,7 +198,7 @@ class DatabaseManager:
|
||||
}
|
||||
|
||||
# 列出与某个对象的所有对话session
|
||||
def list_history(self, session_name: str, capacity: int, page: int):
|
||||
def list_history(self, session_name: str, capacity: int, page: int, replace: str = ""):
|
||||
self.execute("""
|
||||
select `name`, `type`, `number`, `create_timestamp`, `last_interact_timestamp`, `prompt`, `status`
|
||||
from `sessions` where `name` = '{}' order by `last_interact_timestamp` desc limit {} offset {}
|
||||
@@ -219,7 +219,7 @@ class DatabaseManager:
|
||||
'subject_number': subject_number,
|
||||
'create_timestamp': create_timestamp,
|
||||
'last_interact_timestamp': last_interact_timestamp,
|
||||
'prompt': prompt
|
||||
'prompt': prompt if replace == "" else prompt.replace(replace, "")
|
||||
})
|
||||
|
||||
return sessions
|
||||
|
||||
Reference in New Issue
Block a user