Skip to content

Commit

Permalink
fix: trim the dirname of attachment send by telegram bot (#2651)
Browse files Browse the repository at this point in the history
  • Loading branch information
athurg authored Dec 21, 2023
1 parent f184d65 commit b143342
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/integration/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"path"
"strconv"
"unicode/utf16"

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b143342

Please sign in to comment.