|
6 | 6 | namespace NetTelegramBotApi.Requests |
7 | 7 | { |
8 | 8 | /// <summary> |
9 | | - /// Use this method to specify a url and receive incoming updates via an outgoing webhook. |
10 | | - /// Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, |
11 | | - /// containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after |
| 9 | + /// Use this method to specify a url and receive incoming updates via an outgoing webhook. |
| 10 | + /// Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, |
| 11 | + /// containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after |
12 | 12 | /// a reasonable amount of attempts. |
13 | 13 | /// </summary> |
14 | 14 | /// <remarks> |
15 | | - /// If you'd like to make sure that the Webhook request comes from Telegram, |
16 | | - /// we recommend using a secret path in the URL, e.g. www.example.com/<secret_path>. |
| 15 | + /// If you'd like to make sure that the Webhook request comes from Telegram, |
| 16 | + /// we recommend using a secret path in the URL, e.g. www.example.com/<secret_path>. |
17 | 17 | /// Since nobody else knows this secret_path, you can be pretty sure it’s us. |
18 | 18 | /// </remarks> |
19 | 19 | public class SetWebhook : SendFileRequestBase<bool> |
@@ -43,10 +43,22 @@ public SetWebhook(string url, FileToSend certificatePublicKey) |
43 | 43 | /// </summary> |
44 | 44 | public string Url { get; set; } |
45 | 45 |
|
| 46 | + /// <summary> |
| 47 | + /// Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. |
| 48 | + /// Defaults to 40. |
| 49 | + /// Use lower values to limit the load on your bot‘s server, and higher values to increase your bot’s throughput. |
| 50 | + /// </summary> |
| 51 | + public byte? MaxConnections { get; set; } |
| 52 | + |
46 | 53 | protected override void AppendParameters(Action<string, string> appendCallback) |
47 | 54 | { |
48 | 55 | appendCallback("url", Url); |
49 | 56 |
|
| 57 | + if (MaxConnections.HasValue) |
| 58 | + { |
| 59 | + appendCallback("max_connections", MaxConnections.Value.ToString()); |
| 60 | + } |
| 61 | + |
50 | 62 | base.AppendParameters(appendCallback); |
51 | 63 | } |
52 | 64 | } |
|
0 commit comments