webhook_ping_pong_bot -> ngrok_ping_pong_bot

This commit is contained in:
Temirkhan Myrzamadi 2020-06-01 13:05:10 +06:00
parent f192504dd6
commit 4c4909f5fd
5 changed files with 8 additions and 7 deletions

View file

@ -391,7 +391,7 @@ The second one produces very strange compiler messages because of the `#[tokio::
Most programming languages have their own implementations of Telegram bots frameworks, so why not Rust? We think Rust provides enough good ecosystem and the language itself to be suitable for writing bots.
### Can I use webhooks?
teloxide doesn't provide special API for working with webhooks due to their nature with lots of subtle settings. Instead, you setup your webhook by yourself, as shown in [webhook_ping_pong_bot](examples/webhook_ping_pong_bot/src/main.rs).
teloxide doesn't provide special API for working with webhooks due to their nature with lots of subtle settings. Instead, you setup your webhook by yourself, as shown in [webhook_ping_pong_bot](examples/ngrok_ping_pong_bot/src/main.rs).
Associated links:
- [Marvin's Marvellous Guide to All Things Webhook](https://core.telegram.org/bots/webhooks)

View file

@ -3,7 +3,8 @@ Just enter the directory (for example, `cd dialogue_bot`) and execute `cargo run
| Bot | Description |
|---|-----------|
| [ping_pong_bot](ping_pong_bot) | Answers "pong" to each incoming message. |
| [webhook_ping_pong_bot](webhook_ping_pong_bot) | How to use webhooks with teloxide. |
| [ngrok_ping_pong_bot](ngrok_ping_pong_bot) | The ngrok version of ping-pong-bot that uses webhooks |
| [heroku_ping_pong_bot](heroku_ping_pong_bot) | The Heroku version of ping-pong-bot that uses webhooks |
| [simple_commands_bot](simple_commands_bot) | Shows how to deal with bot's commands. |
| [guess_a_number_bot](guess_a_number_bot) | The "guess a number" game. |
| [dialogue_bot](dialogue_bot) | Drive a dialogue with a user using a type-safe finite automaton. |

View file

@ -1,5 +1,5 @@
// The version of ping-pong-bot, which uses a webhook to receive updates from
// Telegram, instead of long polling.
// The version of Heroku ping-pong-bot, which uses a webhook to receive updates
// from Telegram, instead of long polling.
use teloxide::{dispatching::update_listeners, prelude::*};
@ -75,7 +75,7 @@ pub async fn webhook<'a>(
async fn run() {
teloxide::enable_logging!();
log::info!("Starting ping_pong_bot!");
log::info!("Starting heroku_ping_pong_bot!");
let bot = Bot::from_env();

View file

@ -1,4 +1,4 @@
// The version of ping-pong-bot, which uses a webhook to receive updates from
// The version of ngrok ping-pong-bot, which uses a webhook to receive updates from
// Telegram, instead of long polling.
use teloxide::{dispatching::update_listeners, prelude::*};
@ -56,7 +56,7 @@ pub async fn webhook<'a>(
async fn run() {
teloxide::enable_logging!();
log::info!("Starting ping_pong_bot!");
log::info!("Starting ngrok_ping_pong_bot!");
let bot = Bot::from_env();