gramjs
gramjs copied to clipboard
InputMediaPhotoExternal doesn't work in client.sendMessage
await client.sendMessage(peer, {
file: [new Api.InputMediaPhotoExternal({
url: 'some url'
})],
message: 'some message'
})
This code throws an exception
RPCError: 400: MEDIA_INVALID (caused by messages.UploadMedia)
But this code works
await client.invoke(
new Api.messages.SendMedia({
peer,
media: new Api.InputMediaPhotoExternal({
url: 'some url'
}),
message: 'some message'
})
)
I expect that client.sendMessage
will work. This method is more convenient to work with. I need to send several photos in one message, but it seems Api.messages.SendMultiMedia
doesn't work with InputMediaPhotoExternal