diff options
author | Grail Finder <wohilas@gmail.com> | 2025-08-07 06:43:02 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-08-07 06:43:02 +0300 |
commit | c58f251745a6dce587aad07d4d25d9520a863a59 (patch) | |
tree | 3689fa3bc8f599dd8971915a9df6d52d0f214440 /session.go | |
parent | 39e8f557cf043d1f1004bbf925330b2a7f264bfc (diff) |
Enha: export chat to export dir
Diffstat (limited to 'session.go')
-rw-r--r-- | session.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,12 +1,13 @@ package main import ( - "gf-lt/models" "encoding/json" "errors" "fmt" + "gf-lt/models" "os" "os/exec" + "path" "path/filepath" "strings" "time" @@ -32,7 +33,8 @@ func exportChat() error { if err != nil { return err } - return os.WriteFile(activeChatName+".json", data, 0666) + fp := path.Join(exportDir, activeChatName+".json") + return os.WriteFile(fp, data, 0666) } func importChat(filename string) error { |