From facd471e7a39c21060e38a0d4f764c04d6604e23 Mon Sep 17 00:00:00 2001 From: iyear Date: Fri, 4 Nov 2022 12:53:43 +0800 Subject: [PATCH] chore(export): enhance robustness --- cmd/chat/export.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/chat/export.go b/cmd/chat/export.go index f45db3cbd1..71b4d6f87d 100644 --- a/cmd/chat/export.go +++ b/cmd/chat/export.go @@ -26,6 +26,10 @@ var cmdExport = &cobra.Command{ to = int(time.Now().Unix()) // it's also the latest message id(very big message id) } + if from > to { + from, to = to, from + } + return chat.Export(cmd.Context(), _chat, from, to, output, _time, msg) }, }