public static Message SendLocation(this BotClient bot, SendLocationArgs args) { if (bot == default) { throw new ArgumentNullException(nameof(bot)); } return(bot.RPC <Message>(MethodNames.SendLocation, args)); }
public static async Task <Message> SendLocationAsync(this BotClient bot, SendLocationArgs 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.SendLocation, args, cancellationToken : cancellationToken).ConfigureAwait(false)); }
public static Message SendLocation(this BotClient api, long chatId, float latitude, float longitude, [Optional] float?horizontalAccuracy, [Optional] uint?livePeriod, [Optional] ushort?heading, [Optional] uint?proximityAlertRadius, [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 SendLocationArgs(chatId, latitude, longitude) { HorizontalAccuracy = horizontalAccuracy, LivePeriod = livePeriod, Heading = heading, ProximityAlertRadius = proximityAlertRadius, DisableNotification = disableNotification, ProtectContent = protectContent, ReplyToMessageId = replyToMessageId, AllowSendingWithoutReply = allowSendingWithoutReply, ReplyMarkup = replyMarkup }; return(api.RPC <Message>(MethodNames.SendLocation, args)); }