mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
webhook_ping_pong_bot -> ngrok_ping_pong_bot
This commit is contained in:
parent
f192504dd6
commit
4c4909f5fd
5 changed files with 8 additions and 7 deletions
|
@ -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)
|
||||
|
|
|
@ -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. |
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
Loading…
Add table
Reference in a new issue