Telegram Bot Api getUpdates 与 setWebhook 方法
Telegram Bot Api getUpdates vs setWebhook methods
telegram bot api 哪个方法更有效,getUpdates 还是 setWebHook?哪个更快?
P.S。
我为 C# 使用电报机器人 api。
通常用于调试的 getUpdates。要发布您的机器人,您需要使用 Webhook。
getUpdates is a pull mechanism, setWebhook is push.
There are some advantages of using a Webhook over getUpdates:
- Avoids your bot having to ask for updates frequently.
- Avoids the need for some kind of polling mechanism in your code.
telegram bot api 哪个方法更有效,getUpdates 还是 setWebHook?哪个更快?
P.S。 我为 C# 使用电报机器人 api。
通常用于调试的 getUpdates。要发布您的机器人,您需要使用 Webhook。
getUpdates is a pull mechanism, setWebhook is push. There are some advantages of using a Webhook over getUpdates:
- Avoids your bot having to ask for updates frequently.
- Avoids the need for some kind of polling mechanism in your code.