1

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?

dkackman
  • 15,179
  • 13
  • 69
  • 123
AsValeO
  • 2,859
  • 3
  • 27
  • 64

1 Answers1

1

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)

Wizou
  • 1,336
  • 13
  • 24