mtproto icon indicating copy to clipboard operation
mtproto copied to clipboard

How to send media?

Open strelov1 opened this issue 7 years ago • 1 comments

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 avatar Dec 15 '17 18:12 strelov1

@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)

bobrovde avatar Jan 25 '18 08:01 bobrovde