mtproto
mtproto copied to clipboard
How to send media?
I try send media
update, err := cli.mtproto.InvokeSync(mtproto.TL_messages_sendMedia{
Silent: false,
Background: false,
Clear_draft: false,
Peer: mtproto.TL_inputPeerChannel{
Channel_id: channelTo.Id,
Access_hash: channelTo.Access_hash},
Reply_to_msg_id: 0,
Media: message.Media,
Random_id: rand.Int63(),
Reply_markup: mtproto.TL_null{},
})
if err != nil {
fmt.Println(err)
log.Fatal(err)
}
cli.parseUpdate(*update)
and recieve INPUT_FETCH_ERROR
@strelov1 when i try to upload media by method messages.saveFilePart
i got same error.
Solve it by change encode method for TL_upload_saveFilePart
in api.go.
I change x.Bytes(e.Bytes)
to x.StringBytes(e.Bytes)