mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 09:49:07 +01:00
Fix links
This commit is contained in:
parent
41d1aebb1e
commit
eebcda4dd8
6 changed files with 31 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
|||
# Contributing
|
||||
Before contributing, please read our [the code style](https://github.com/teloxide/teloxide/blob/dev/CODE_STYLE.md).
|
||||
Before contributing, please read our [the code style](https://github.com/teloxide/teloxide/blob/master/CODE_STYLE.md).
|
||||
|
||||
To change the source code, fork this repository and work inside your own branch. Then send us a PR and wait for the CI to check everything. However, you'd better check changes first locally:
|
||||
|
||||
|
|
12
README.md
12
README.md
|
@ -52,7 +52,7 @@ pretty_env_logger = "0.4.0"
|
|||
## The ping-pong bot
|
||||
This bot has a single message handler, which answers "pong" to each incoming message:
|
||||
|
||||
([Full](https://github.com/teloxide/teloxide/blob/dev/examples/ping_pong_bot/src/main.rs))
|
||||
([Full](https://github.com/teloxide/teloxide/blob/master/examples/ping_pong_bot/src/main.rs))
|
||||
```rust
|
||||
use teloxide::prelude::*;
|
||||
|
||||
|
@ -80,7 +80,7 @@ async fn main() {
|
|||
## Commands
|
||||
Commands are defined similar to how we define CLI using [structopt](https://docs.rs/structopt/0.3.9/structopt/). This bot says "I am a cat! Meow!" on `/meow`, generates a random number within [0; 1) on `/generate`, and shows the usage guide on `/help`:
|
||||
|
||||
([Full](https://github.com/teloxide/teloxide/blob/dev/examples/simple_commands_bot/src/main.rs))
|
||||
([Full](https://github.com/teloxide/teloxide/blob/master/examples/simple_commands_bot/src/main.rs))
|
||||
```rust
|
||||
// Imports are omitted...
|
||||
|
||||
|
@ -141,7 +141,7 @@ async fn main() {
|
|||
## Guess a number
|
||||
Wanna see more? This is a bot, which starts a game on each incoming message. You must guess a number from 1 to 10 (inclusively):
|
||||
|
||||
([Full](https://github.com/teloxide/teloxide/blob/dev/examples/guess_a_number_bot/src/main.rs))
|
||||
([Full](https://github.com/teloxide/teloxide/blob/master/examples/guess_a_number_bot/src/main.rs))
|
||||
```rust
|
||||
// Imports are omitted...
|
||||
|
||||
|
@ -224,9 +224,9 @@ async fn main() {
|
|||
<img src=https://github.com/teloxide/teloxide/raw/master/media/GUESS_A_NUMBER_BOT.png width="400" />
|
||||
</div>
|
||||
|
||||
Our [finite automaton](https://en.wikipedia.org/wiki/Finite-state_machine), designating a user dialogue, cannot be in an invalid state. See [examples/dialogue_bot](https://github.com/teloxide/teloxide/blob/dev/examples/dialogue_bot/src/main.rs) to see a bit more complicated bot with dialogues.
|
||||
Our [finite automaton](https://en.wikipedia.org/wiki/Finite-state_machine), designating a user dialogue, cannot be in an invalid state. See [examples/dialogue_bot](https://github.com/teloxide/teloxide/blob/master/examples/dialogue_bot/src/main.rs) to see a bit more complicated bot with dialogues.
|
||||
|
||||
[See more examples](https://github.com/teloxide/teloxide/tree/dev/examples).
|
||||
[See more examples](https://github.com/teloxide/teloxide/tree/master/examples).
|
||||
|
||||
## Recommendations
|
||||
- Use this pattern:
|
||||
|
@ -254,4 +254,4 @@ Our [finite automaton](https://en.wikipedia.org/wiki/Finite-state_machine), desi
|
|||
The second one produces very strange compiler messages because of the `#[tokio::main]` macro. However, the examples in this README use the second variant for brevity.
|
||||
|
||||
## Contributing
|
||||
See [CONRIBUTING.md](https://github.com/teloxide/teloxide/blob/dev/CONTRIBUTING.md).
|
||||
See [CONRIBUTING.md](https://github.com/teloxide/teloxide/blob/master/CONTRIBUTING.md).
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
//! [`DialogueStage::Next`]: crate::dispatching::dialogue::DialogueStage::Next
|
||||
//! [`CtxHandler`]: crate::dispatching::CtxHandler
|
||||
//! [`Dispatcher`]: crate::dispatching::Dispatcher
|
||||
//! [examples/dialogue_bot]: https://github.com/teloxide/teloxide/tree/dev/examples/dialogue_bot
|
||||
//! [examples/dialogue_bot]: https://github.com/teloxide/teloxide/tree/master/examples/dialogue_bot
|
||||
|
||||
#![allow(clippy::module_inception)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
//! # }
|
||||
//! ```
|
||||
//!
|
||||
//! [Full](https://github.com/teloxide/teloxide/blob/dev/examples/ping_pong_bot/)
|
||||
//! [Full](https://github.com/teloxide/teloxide/blob/master/examples/ping_pong_bot/)
|
||||
//!
|
||||
//! ### Multiple handlers
|
||||
//!
|
||||
|
@ -88,7 +88,7 @@
|
|||
//! # }
|
||||
//! ```
|
||||
//!
|
||||
//! [Full](https://github.com/teloxide/teloxide/blob/dev/examples/miltiple_handlers_bot/)
|
||||
//! [Full](https://github.com/teloxide/teloxide/blob/master/examples/miltiple_handlers_bot/)
|
||||
//!
|
||||
//! For a bit more complicated example, please see [examples/dialogue_bot].
|
||||
//!
|
||||
|
@ -100,7 +100,7 @@
|
|||
//! [`DialogueDispatcher`]: crate::dispatching::dialogue::DialogueDispatcher
|
||||
//! [`DispatcherHandlerResult`]: crate::dispatching::DispatcherHandlerResult
|
||||
//! [`Bot`]: crate::Bot
|
||||
//! [examples/dialogue_bot]: https://github.com/teloxide/teloxide/tree/dev/examples/dialogue_bot
|
||||
//! [examples/dialogue_bot]: https://github.com/teloxide/teloxide/tree/master/examples/dialogue_bot
|
||||
|
||||
mod ctx_handlers;
|
||||
pub mod dialogue;
|
||||
|
|
26
src/lib.rs
26
src/lib.rs
|
@ -49,7 +49,7 @@
|
|||
//! This bot has a single message handler, which answers "pong" to each incoming
|
||||
//! message:
|
||||
//!
|
||||
//! ([Full](https://github.com/teloxide/teloxide/blob/dev/examples/ping_pong_bot/src/main.rs))
|
||||
//! ([Full](https://github.com/teloxide/teloxide/blob/master/examples/ping_pong_bot/src/main.rs))
|
||||
//! ```rust,no_run
|
||||
//! use teloxide::prelude::*;
|
||||
//!
|
||||
|
@ -70,12 +70,16 @@
|
|||
//! # }
|
||||
//! ```
|
||||
//!
|
||||
//! <div align="center">
|
||||
//! <img src=https://github.com/teloxide/teloxide/raw/master/media/GUESS_A_NUMBER_BOT.png width="400" />
|
||||
//! </div>
|
||||
//!
|
||||
//! ## Commands
|
||||
//! Commands are defined similar to how we define CLI using [structopt]. This
|
||||
//! bot says "I am a cat! Meow!" on `/meow`, generates a random number within
|
||||
//! [0; 1) on `/generate`, and shows the usage guide on `/help`:
|
||||
//!
|
||||
//! ([Full](https://github.com/teloxide/teloxide/blob/dev/examples/simple_commands_bot/src/main.rs))
|
||||
//! ([Full](https://github.com/teloxide/teloxide/blob/master/examples/simple_commands_bot/src/main.rs))
|
||||
//! ```rust,no_run
|
||||
//! # use teloxide::{prelude::*, utils::command::BotCommand};
|
||||
//! # use rand::{thread_rng, Rng};
|
||||
|
@ -142,11 +146,15 @@
|
|||
//! }
|
||||
//! ```
|
||||
//!
|
||||
//! <div align="center">
|
||||
//! <img src=https://github.com/teloxide/teloxide/raw/master/media/SIMPLE_COMMANDS_BOT.png width="400" />
|
||||
//! </div>
|
||||
//!
|
||||
//! ## Guess a number
|
||||
//! Wanna see more? This is a bot, which starts a game on each incoming message.
|
||||
//! You must guess a number from 1 to 10 (inclusively):
|
||||
//!
|
||||
//! ([Full](https://github.com/teloxide/teloxide/blob/dev/examples/guess_a_number_bot/src/main.rs))
|
||||
//! ([Full](https://github.com/teloxide/teloxide/blob/master/examples/guess_a_number_bot/src/main.rs))
|
||||
//! ```rust,no_run
|
||||
//! # #[macro_use]
|
||||
//! # extern crate smart_default;
|
||||
|
@ -234,11 +242,15 @@
|
|||
//! }
|
||||
//! ```
|
||||
//!
|
||||
//! <div align="center">
|
||||
//! <img src=https://github.com/teloxide/teloxide/raw/master/media/GUESS_A_NUMBER_BOT.png width="400" />
|
||||
//! </div>
|
||||
//!
|
||||
//! Our [finite automaton], designating a user dialogue, cannot be in an invalid
|
||||
//! state. See [examples/dialogue_bot] to see a bit more complicated bot with
|
||||
//! dialogues.
|
||||
//!
|
||||
//! [See more examples](https://github.com/teloxide/teloxide/tree/dev/examples).
|
||||
//! [See more examples](https://github.com/teloxide/teloxide/tree/master/examples).
|
||||
//!
|
||||
//! ## Recommendations
|
||||
//!
|
||||
|
@ -272,13 +284,13 @@
|
|||
//! [`async`/`.await`]: https://rust-lang.github.io/async-book/01_getting_started/01_chapter.html
|
||||
//! [Rust]: https://www.rust-lang.org/
|
||||
//! [finite automaton]: https://en.wikipedia.org/wiki/Finite-state_machine
|
||||
//! [examples/dialogue_bot]: https://github.com/teloxide/teloxide/blob/dev/examples/dialogue_bot/src/main.rs
|
||||
//! [examples/dialogue_bot]: https://github.com/teloxide/teloxide/blob/master/examples/dialogue_bot/src/main.rs
|
||||
//! [structopt]: https://docs.rs/structopt/0.3.9/structopt/
|
||||
//! [@Botfather]: https://t.me/botfather
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://github.com/teloxide/teloxide/raw/dev/logo.svg",
|
||||
html_favicon_url = "https://github.com/teloxide/teloxide/raw/dev/ICON.png"
|
||||
html_logo_url = "https://github.com/teloxide/teloxide/raw/master/logo.svg",
|
||||
html_favicon_url = "https://github.com/teloxide/teloxide/raw/master/ICON.png"
|
||||
)]
|
||||
#![allow(clippy::match_bool)]
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
//! [`parse_command`]: crate::utils::command::parse_command
|
||||
//! [`parse_command_with_prefix`]:
|
||||
//! crate::utils::command::parse_command_with_prefix
|
||||
//! [examples/admin_bot]: https://github.com/teloxide/teloxide/blob/dev/examples/miltiple_handlers_bot/
|
||||
//! [examples/admin_bot]: https://github.com/teloxide/teloxide/blob/master/examples/miltiple_handlers_bot/
|
||||
|
||||
pub use teloxide_macros::BotCommand;
|
||||
|
||||
|
|
Loading…
Reference in a new issue