diff --git a/.github/dev.yml b/.github/dev.yml index 4bbcd13..a366488 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -2,7 +2,7 @@ pr: none trigger: - master -name: 2.0.0-dev.$(Rev:r) +name: 2.0.1-dev.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/.github/release.yml b/.github/release.yml index b6d49b0..2ee03d4 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,7 +1,7 @@ pr: none trigger: none -name: 2.0.0 +name: 2.0.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/EXAMPLES.md b/EXAMPLES.md index 1c25d5d..b866590 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -156,6 +156,27 @@ var inputFile = await client.UploadFileAsync(Filepath); await client.SendMediaAsync(peer, "Here is the photo", inputFile); ``` + +### Send a grouped media album using photos from various sources +```csharp +// Photo 1 already on Telegram: latest photo found in the user's Saved Messages +var history = await client.Messages_GetHistory(InputPeer.Self, 0, default, 0, 100, 0, 0, 0); +PhotoBase photoFromTelegram = history.Messages.OfType().Select(m => m.media).OfType().First().photo; +// Photo 2 uploaded now from our computer: +var uploadedFile = await client.UploadFileAsync(@"C:\Pictures\flower.jpg"); +// Photo 3 specified by external url: +const string photoUrl = "https://picsum.photos/310/200.jpg"; + +var inputMedias = new InputMedia[] +{ + photoFromTelegram, // PhotoBase has implicit conversion to InputMediaPhoto + new InputMediaUploadedPhoto { file = uploadedFile }, + new InputMediaPhotoExternal() { url = photoUrl }, +}; +await client.SendAlbumAsync(InputPeer.Self, inputMedias, "My first album"); +``` +*Note: Don't mix Photos and file Documents in your album, it doesn't work well* + ### List all dialogs (chats/groups/channels/user chat) the user is in ```csharp