I want to develop a bot for a business! I don't know that using getUpdates method for develop a windows desktop application and run that on vps (by https://github.com/MrRoundRobin/telegram.bot library) or using setWebhook method to develop bot with php!
Which one is better in terms of speed and etc? And what are some other differences?
Bots in Telegram will look different from human users: their chat and profile screens have a slightly different UI and they don't have access to all messages by default when added to groups.
Obtaining api_id Sign up for Telegram using any application. Log in to your Telegram core: https://my.telegram.org. Go to "API development tools" and fill out the form. You will get basic addresses as well as the api_id and api_hash parameters required for user authorization.
Setting up a webhook means that you will provide Telegram with a URL that is accessible from the public internet. Whenever a new message is sent to your bot, Telegram (and not you!) will take the initiative and send a request with the update object to your server.
Create a Telegram bot NOTE: Bots can't message people first, but can message channels.
It does not matter you want to use which kind of server side applications.
Typically getUpdates
used for debugging. For publishing your bots, you need to using the Webhook
. See this.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With