| | | 1 | | using TeleFlow.Telegram.Schema.Abstractions; |
| | | 2 | | using TeleFlow.Telegram.Schema.Types; |
| | | 3 | | |
| | | 4 | | namespace TeleFlow.Telegram; |
| | | 5 | | |
| | | 6 | | public static class TelegramClientMediaGroupExtensions |
| | | 7 | | { |
| | | 8 | | public static Task<IReadOnlyList<Message>> SendMediaGroupAsync( |
| | | 9 | | this ITelegramClient bot, |
| | | 10 | | IntegerString chatId, |
| | | 11 | | MediaGroup media, |
| | | 12 | | string? businessConnectionId = null, |
| | | 13 | | long? messageThreadId = null, |
| | | 14 | | long? directMessagesTopicId = null, |
| | | 15 | | bool? disableNotification = null, |
| | | 16 | | bool? protectContent = null, |
| | | 17 | | bool? allowPaidBroadcast = null, |
| | | 18 | | string? messageEffectId = null, |
| | | 19 | | ReplyParameters? replyParameters = null, |
| | | 20 | | CancellationToken cancellationToken = default) |
| | | 21 | | { |
| | 3 | 22 | | ArgumentNullException.ThrowIfNull(bot); |
| | 3 | 23 | | ArgumentNullException.ThrowIfNull(media); |
| | | 24 | | |
| | 3 | 25 | | return bot.SendMediaGroupAsync( |
| | 3 | 26 | | chatId, |
| | 3 | 27 | | media.ToMedia(), |
| | 3 | 28 | | businessConnectionId, |
| | 3 | 29 | | messageThreadId, |
| | 3 | 30 | | directMessagesTopicId, |
| | 3 | 31 | | disableNotification, |
| | 3 | 32 | | protectContent, |
| | 3 | 33 | | allowPaidBroadcast, |
| | 3 | 34 | | messageEffectId, |
| | 3 | 35 | | replyParameters, |
| | 3 | 36 | | cancellationToken); |
| | | 37 | | } |
| | | 38 | | } |