public static async Task <bool> SetWebhookAsync(this BotClient bot, SetWebhookArgs args, [Optional] CancellationToken cancellationToken) { if (bot == default) { throw new ArgumentNullException(nameof(bot)); } if (args == default) { throw new ArgumentNullException(nameof(args)); } return(await bot.RPCAF <bool>(MethodNames.SetWebhook, args, cancellationToken : cancellationToken).ConfigureAwait(false)); }
public static bool SetWebhook(this BotClient bot, SetWebhookArgs args) { if (bot == default) { throw new ArgumentNullException(nameof(bot)); } if (args == default) { throw new ArgumentNullException(nameof(args)); } return(bot.RPCF <bool>(MethodNames.SetWebhook, args)); }
public static bool SetWebhook(this BotClient api, string url, [Optional] InputFile?certificate, [Optional] string?ipAddress, [Optional] uint?maxConnections, [Optional] IEnumerable <string>?allowedUpdates, [Optional] bool?dropPendingUpdates, [Optional] string?secretToken) { if (api == null) { throw new ArgumentNullException(nameof(api)); } var args = new SetWebhookArgs(url) { Certificate = certificate, IpAddress = ipAddress, MaxConnections = maxConnections, AllowedUpdates = allowedUpdates, DropPendingUpdates = dropPendingUpdates, SecretToken = secretToken }; return(api.RPCF <bool>(MethodNames.SetWebhook, args)); }