public static Message EditMessageCaption(this BotClient bot, EditMessageCaptionArgs args)
 {
     if (bot == default)
     {
         throw new ArgumentNullException(nameof(bot));
     }
     if (args == default)
     {
         throw new ArgumentNullException(nameof(args));
     }
     return(bot.RPC <Message>(MethodNames.EditMessageCaption, args));
 }
 public static async Task <T> EditMessageCaptionAsync <T>(this BotClient bot, EditMessageCaptionArgs args, [Optional] CancellationToken cancellationToken)
 {
     if (bot == default)
     {
         throw new ArgumentNullException(nameof(bot));
     }
     if (args == default)
     {
         throw new ArgumentNullException(nameof(args));
     }
     if (typeof(T) != typeof(Message) && typeof(T) != typeof(bool))
     {
         throw new ArgumentException($"{nameof(T)} must be Telegram.BotAPI.AvailableTypes.Message or bool.");
     }
     return(await bot.RPCA <T>(MethodNames.EditMessageCaption, args, cancellationToken).ConfigureAwait(false));
 }
 public static T EditMessageCaption <T>(this BotClient bot, EditMessageCaptionArgs args)
 {
     if (bot == default)
     {
         throw new ArgumentNullException(nameof(bot));
     }
     if (args == default)
     {
         throw new ArgumentNullException(nameof(args));
     }
     if (typeof(T) != typeof(Message) && typeof(T) != typeof(bool))
     {
         throw new ArgumentException($"{nameof(T)} must be Telegram.BotAPI.AvailableTypes.Message or bool.");
     }
     return(bot.RPC <T>(MethodNames.EditMessageCaption, args));
 }
        public static async Task <Message> EditMessageCaptionAsync(this BotClient api, string inlineMessageId, [Optional] string?caption, [Optional] string?parseMode, [Optional] IEnumerable <MessageEntity>?captionEntities, [Optional] InlineKeyboardMarkup?replyMarkup, [Optional] CancellationToken cancellationToken)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new EditMessageCaptionArgs(inlineMessageId)
            {
                Caption         = caption,
                ParseMode       = parseMode,
                CaptionEntities = captionEntities,
                ReplyMarkup     = replyMarkup
            };

            return(await api.RPCA <Message>(MethodNames.EditMessageCaption, args, cancellationToken).ConfigureAwait(false));
        }
        public static Message EditMessageCaption(this BotClient api, string inlineMessageId, [Optional] string?caption, [Optional] string?parseMode, [Optional] IEnumerable <MessageEntity>?captionEntities, [Optional] InlineKeyboardMarkup?replyMarkup)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            var args = new EditMessageCaptionArgs(inlineMessageId)
            {
                Caption         = caption,
                ParseMode       = parseMode,
                CaptionEntities = captionEntities,
                ReplyMarkup     = replyMarkup
            };

            return(api.RPC <Message>(MethodNames.EditMessageCaption, args));
        }
        public static async Task <T> EditMessageCaptionAsync <T>(this BotClient api, string inlineMessageId, [Optional] string?caption, [Optional] string?parseMode, [Optional] IEnumerable <MessageEntity>?captionEntities, [Optional] InlineKeyboardMarkup?replyMarkup, [Optional] CancellationToken cancellationToken)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            if (typeof(T) != typeof(Message) && typeof(T) != typeof(bool))
            {
                throw new ArgumentException($"{nameof(T)} must be Telegram.BotAPI.AvailableTypes.Message or bool.");
            }
            var args = new EditMessageCaptionArgs(inlineMessageId)
            {
                Caption         = caption,
                ParseMode       = parseMode,
                CaptionEntities = captionEntities,
                ReplyMarkup     = replyMarkup
            };

            return(await api.RPCA <T>(MethodNames.EditMessageCaption, args, cancellationToken).ConfigureAwait(false));
        }
        public static T EditMessageCaption <T>(this BotClient api, string chatId, int messageId, [Optional] string?caption, [Optional] string?parseMode, [Optional] IEnumerable <MessageEntity>?captionEntities, [Optional] InlineKeyboardMarkup?replyMarkup)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            if (typeof(T) != typeof(Message) && typeof(T) != typeof(bool))
            {
                throw new ArgumentException($"{nameof(T)} must be Telegram.BotAPI.AvailableTypes.Message or bool.");
            }
            var args = new EditMessageCaptionArgs(chatId, messageId)
            {
                Caption         = caption,
                ParseMode       = parseMode,
                CaptionEntities = captionEntities,
                ReplyMarkup     = replyMarkup
            };

            return(api.RPC <T>(MethodNames.EditMessageCaption, args));
        }
 public static async Task <Message> EditMessageCaptionAsync(this BotClient bot, EditMessageCaptionArgs args, [Optional] CancellationToken cancellationToken)
 {
     if (bot == default)
     {
         throw new ArgumentNullException(nameof(bot));
     }
     if (args == default)
     {
         throw new ArgumentNullException(nameof(args));
     }
     return(await bot.RPCA <Message>(MethodNames.EditMessageCaption, args, cancellationToken).ConfigureAwait(false));
 }