Post telegram message with single external photo:
var im = new InputMediaPhotoExternal();
im.url = a.Photo;
await client.SendMessageAsync(target, null, im);
Is it possible to post message with multiple external photos using WTelegramClient
?
Post telegram message with single external photo:
var im = new InputMediaPhotoExternal();
im.url = a.Photo;
await client.SendMessageAsync(target, null, im);
Is it possible to post message with multiple external photos using WTelegramClient
?
After investigation, I found out Telegram doesn't normally accept external URLs in grouped albums.
However I have now added in WTelegramClient (version 2.0.0 or more recent) a new helper method SendAlbumAsync
that simplify the sending of grouped media (albums) and that also supports external photo/documents:
InputPeer target = InputPeer.Self;
var inputMedias = new InputMedia[]
{
new InputMediaPhotoExternal() { url = "https://picsum.photos/200/200.jpg" },
new InputMediaPhotoExternal() { url = "https://picsum.photos/310/200.jpg" },
};
await client.SendAlbumAsync(target, inputMedias, "caption");
(external URLs are downloaded automatically by WTelegramClient using HttpClient, and uploaded to Telegram)