feat: !delhst 指令支持管理员删除会话历史记录

This commit is contained in:
Rock Chin
2023-03-10 21:20:19 +08:00
parent 69610a674c
commit b920ced6d4
2 changed files with 18 additions and 0 deletions

View File

@@ -256,6 +256,12 @@ class DatabaseManager:
""".format(session_name))
return self.cursor.rowcount > 0
def delete_all_session_history(self) -> bool:
self.__execute__("""
delete from `sessions`
""")
return self.cursor.rowcount > 0
# 将apikey的使用量存进数据库
def dump_api_key_usage(self, api_keys: dict, usage: dict):
logging.debug('dumping api key usage...')