Commit d0e1cc7

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-06-10 17:41:26
chore(history): change command line option from `--list` to `-l`
1 parent 3a2ef45
Changed files (1)
src
history
src/history/query.py
@@ -43,7 +43,7 @@ HELP = f"""🗣**查询当前对话聊天记录**
 查询所有对话的聊天记录
 但出于隐私考虑, 本命令会限制使用权限
 `/history + #ChatID` + [日期]+[用户名]+[关键词]
-`/history --list`: 列出所有ChatID
+`/history -l`: 列出所有ChatID
 """
 
 
@@ -61,7 +61,7 @@ async def query_chat_history(client: Client, message: Message, **kwargs):
         await send2tg(client, message, texts="⚠️您无权使用此命令", **kwargs)
         return
 
-    if info["text"].strip() == "/history --list":
+    if info["text"].strip() == "/history -l":
         await list_chat_ids(client, message)
         return
     qtype = "history" if startswith_prefix(info["text"].strip(), prefix="/history") else "hist"
@@ -155,7 +155,7 @@ def parse_queries(texts: str, qtype: str) -> tuple[str, str, str, str, str]:
         if not any((chat_id, match_time, user, keyword)):
             error = f"查询格式有误, 请发送 `{PREFIX.HISTORY}` 命令查看帮助"
         if not chat_id:
-            error = "`/history` 命令需要指定 ChatID\n`/history --list`: 列出所有ChatID"
+            error = "`/history` 命令需要指定 ChatID\n`/history -l`: 列出所有ChatID"
 
     return chat_id, match_time, user, keyword, error