From c84fa49600edd8d1faaad3f08c5db975ddba821c Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Tue, 1 Nov 2022 16:50:24 +0400 Subject: [PATCH] Fix teloxide readme --- README.md | 12 ++++++------ crates/teloxide/README.md | 3 +++ crates/teloxide/src/lib.rs | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 crates/teloxide/README.md diff --git a/README.md b/README.md index f211a547..1087a09d 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ tokio = { version = "1.8", features = ["rt-multi-thread", "macros"] } This bot replies with a die throw to each received message: -[[`examples/throw_dice.rs`](examples/throw_dice.rs)] +[[`examples/throw_dice.rs`](crates/teloxide/examples/throw_dice.rs)] ```rust,no_run use teloxide::prelude::*; @@ -120,7 +120,7 @@ Commands are strongly typed and defined declaratively, similar to how we define [structopt]: https://docs.rs/structopt/0.3.9/structopt/ [serde-json]: https://github.com/serde-rs/json -[[`examples/command.rs`](examples/command.rs)] +[[`examples/command.rs`](crates/teloxide/examples/command.rs)] ```rust,no_run use teloxide::{prelude::*, utils::command::BotCommands}; @@ -174,7 +174,7 @@ A dialogue is typically described by an enumeration where each variant is one po Below is a bot that asks you three questions and then sends the answers back to you: -[[`examples/dialogue.rs`](examples/dialogue.rs)] +[[`examples/dialogue.rs`](crates/teloxide/examples/dialogue.rs)] ```rust,ignore use teloxide::{dispatching::dialogue::InMemStorage, prelude::*}; @@ -285,7 +285,7 @@ async fn receive_location( -[More examples >>](examples/) +[More examples >>](crates/teloxide/examples/) ## FAQ @@ -307,11 +307,11 @@ A: No, only the bots API. **Q: Can I use webhooks?** -A: You can! `teloxide` has a built-in support for webhooks in `dispatching::update_listeners::webhooks` module. See how it's used in [`examples/ngrok_ping_pong_bot`](examples/ngrok_ping_pong.rs) and [`examples/heroku_ping_pong_bot`](examples/heroku_ping_pong.rs). +A: You can! `teloxide` has a built-in support for webhooks in `dispatching::update_listeners::webhooks` module. See how it's used in [`examples/ngrok_ping_pong_bot`](crates/teloxide/examples/ngrok_ping_pong.rs) and [`examples/heroku_ping_pong_bot`](crates/teloxide/examples/heroku_ping_pong.rs). **Q: Can I handle both callback queries and messages within a single dialogue?** -A: Yes, see [`examples/purchase.rs`](examples/purchase.rs). +A: Yes, see [`examples/purchase.rs`](crates/teloxide/examples/purchase.rs). ## Community bots diff --git a/crates/teloxide/README.md b/crates/teloxide/README.md new file mode 100644 index 00000000..e2ce90e9 --- /dev/null +++ b/crates/teloxide/README.md @@ -0,0 +1,3 @@ +See [`README.md`] at the root of the repository. + +[`README.md`]: ../../README.md diff --git a/crates/teloxide/src/lib.rs b/crates/teloxide/src/lib.rs index 04012a60..b401de2a 100644 --- a/crates/teloxide/src/lib.rs +++ b/crates/teloxide/src/lib.rs @@ -79,7 +79,7 @@ pub use dispatching::filter_command; pub use dptree::{self, case as handler}; #[cfg(all(feature = "nightly", doctest))] -#[cfg_attr(feature = "nightly", cfg_attr(feature = "nightly", doc = include_str!("../README.md")))] +#[cfg_attr(feature = "nightly", cfg_attr(feature = "nightly", doc = include_str!("../../README.md")))] enum ReadmeDocTests {} use teloxide_core::requests::ResponseResult;