mirror of
https://github.com/usememos/memos.git
synced 2025-03-04 01:04:38 +08:00
fix: trim the dirname of attachment send by telegram bot (#2651)
This commit is contained in:
parent
f184d65267
commit
b14334220f
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
"unicode/utf16"
|
"unicode/utf16"
|
||||||
|
|
||||||
|
@ -84,7 +85,7 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot,
|
||||||
// Fill the common field of create
|
// Fill the common field of create
|
||||||
create := store.Resource{
|
create := store.Resource{
|
||||||
CreatorID: creatorID,
|
CreatorID: creatorID,
|
||||||
Filename: attachment.FileName,
|
Filename: path.Base(attachment.FileName),
|
||||||
Type: attachment.GetMimeType(),
|
Type: attachment.GetMimeType(),
|
||||||
Size: attachment.FileSize,
|
Size: attachment.FileSize,
|
||||||
MemoID: &memoMessage.ID,
|
MemoID: &memoMessage.ID,
|
||||||
|
|
Loading…
Reference in a new issue