fix: trim the dirname of attachment send by telegram bot (#2651)

This commit is contained in:
Athurg Gooth 2023-12-21 09:47:57 +08:00 committed by GitHub
parent f184d65267
commit b14334220f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"path"
"strconv"
"unicode/utf16"
@ -84,7 +85,7 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot,
// Fill the common field of create
create := store.Resource{
CreatorID: creatorID,
Filename: attachment.FileName,
Filename: path.Base(attachment.FileName),
Type: attachment.GetMimeType(),
Size: attachment.FileSize,
MemoID: &memoMessage.ID,