public static async Task <Message> SendPhotoAsync(this BotClient bot, SendPhotoArgs args, [Optional] CancellationToken cancellationToken) { if (bot == null) { throw new ArgumentNullException(nameof(bot)); } if (args == null) { throw new ArgumentNullException(nameof(args)); } return(await bot.RPCAF <Message>(MethodNames.SendPhoto, args, cancellationToken).ConfigureAwait(false)); }
public static Message SendPhoto(this BotClient bot, SendPhotoArgs args) { if (bot == null) { throw new ArgumentNullException(nameof(bot)); } if (args == null) { throw new ArgumentNullException(nameof(args)); } return(bot.RPCF <Message>(MethodNames.SendPhoto, args)); }
public static Message SendPhoto(this BotClient api, long chatId, InputFile photo, [Optional] string?caption, [Optional] string?parseMode, [Optional] IEnumerable <MessageEntity>?captionEntities, [Optional] bool?disableNotification, [Optional] bool?protectContent, [Optional] int?replyToMessageId, [Optional] bool?allowSendingWithoutReply, [Optional] ReplyMarkup?replyMarkup) { if (api == null) { throw new ArgumentNullException(nameof(api)); } var args = new SendPhotoArgs(chatId, photo) { Caption = caption, ParseMode = parseMode, CaptionEntities = captionEntities, DisableNotification = disableNotification, ProtectContent = protectContent, ReplyToMessageId = replyToMessageId, AllowSendingWithoutReply = allowSendingWithoutReply, ReplyMarkup = replyMarkup }; return(api.RPCF <Message>(MethodNames.SendPhoto, args)); }
public static async Task <Message> SendPhotoAsync(this BotClient api, string chatId, string photo, [Optional] string?caption, [Optional] string?parseMode, [Optional] IEnumerable <MessageEntity>?captionEntities, [Optional] bool?disableNotification, [Optional] bool?protectContent, [Optional] int?replyToMessageId, [Optional] bool?allowSendingWithoutReply, [Optional] ReplyMarkup?replyMarkup, [Optional] CancellationToken cancellationToken) { if (api == null) { throw new ArgumentNullException(nameof(api)); } var args = new SendPhotoArgs(chatId, photo) { Caption = caption, ParseMode = parseMode, CaptionEntities = captionEntities, DisableNotification = disableNotification, ProtectContent = protectContent, ReplyToMessageId = replyToMessageId, AllowSendingWithoutReply = allowSendingWithoutReply, ReplyMarkup = replyMarkup }; return(await api.RPCAF <Message>(MethodNames.SendPhoto, args, cancellationToken).ConfigureAwait(false)); }