Skip to content

Commit

Permalink
try, add caption
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe authored Nov 20, 2024
1 parent 2a4015d commit f79720b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/services/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,15 @@ func (fs *FileService) CopyFile(c *gin.Context) (*schemas.FileOut, *types.AppErr
media := item.Media.(*tg.MessageMediaDocument)
document := media.Document.(*tg.Document)

caption := fmt.Sprintf("%s_%s", res[0].id, res[0].Name)

id, _ := randInt64()
request := tg.MessagesSendMediaRequest{
Silent: true,
Peer: &tg.InputPeerChannel{ChannelID: channel.ChannelID, AccessHash: channel.AccessHash},
Media: &tg.InputMediaDocument{ID: document.AsInput()},
RandomID: id,
Message: caption,
}
res, err := client.API().MessagesSendMedia(c, &request)

Expand Down

0 comments on commit f79720b

Please sign in to comment.