mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Merge pull request #612 from teloxide/update-examples-stuff
Update examples and GIFs
Former-commit-id: dbc53db533
This commit is contained in:
commit
fd92bd5ba7
21 changed files with 26 additions and 23 deletions
|
@ -126,7 +126,7 @@ name = "dialogue"
|
|||
required-features = ["macros"]
|
||||
|
||||
[[example]]
|
||||
name = "simple_commands"
|
||||
name = "command"
|
||||
required-features = ["macros"]
|
||||
|
||||
[[example]]
|
||||
|
|
16
README.md
16
README.md
|
@ -84,7 +84,7 @@ tokio = { version = "1.8", features = ["rt-multi-thread", "macros"] }
|
|||
|
||||
This bot replies with a dice throw to each received message:
|
||||
|
||||
([Full](examples/dices.rs))
|
||||
([Full](examples/throw_dice.rs))
|
||||
|
||||
```rust,no_run
|
||||
use teloxide::prelude::*;
|
||||
|
@ -92,7 +92,7 @@ use teloxide::prelude::*;
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting dices_bot...");
|
||||
log::info!("Starting throw dice bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
@ -106,7 +106,7 @@ async fn main() {
|
|||
|
||||
<div align="center">
|
||||
<kbd>
|
||||
<img src=../../raw/master/media/DICES_BOT.gif />
|
||||
<img src=../../raw/master/media/throw-dice.gif />
|
||||
</kbd>
|
||||
</div>
|
||||
|
||||
|
@ -121,7 +121,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
|
||||
|
||||
([Full](examples/simple_commands.rs))
|
||||
([Full](examples/command.rs))
|
||||
|
||||
```rust,no_run
|
||||
use teloxide::{prelude::*, utils::command::BotCommands};
|
||||
|
@ -131,7 +131,7 @@ use std::error::Error;
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting simple_commands_bot...");
|
||||
log::info!("Starting command bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
@ -176,7 +176,7 @@ async fn answer(
|
|||
|
||||
<div align="center">
|
||||
<kbd>
|
||||
<img src=../../raw/master/media/SIMPLE_COMMANDS_BOT.gif />
|
||||
<img src=../../raw/master/media/command.gif />
|
||||
</kbd>
|
||||
</div>
|
||||
|
||||
|
@ -213,7 +213,7 @@ impl Default for State {
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting dialogue_bot...");
|
||||
log::info!("Starting dialogue bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
@ -302,7 +302,7 @@ async fn receive_location(
|
|||
|
||||
<div align="center">
|
||||
<kbd>
|
||||
<img src=../../raw/master/media/DIALOGUE_BOT.gif />
|
||||
<img src=../../raw/master/media/dialogue.gif />
|
||||
</kbd>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ impl FromStr for UnitOfTime {
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting admin_bot...");
|
||||
log::info!("Starting admin bot...");
|
||||
|
||||
let bot = teloxide::Bot::from_env().auto_send();
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ enum Command {
|
|||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn Error>> {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting bot...");
|
||||
log::info!("Starting buttons bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::error::Error;
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting simple_commands_bot...");
|
||||
log::info!("Starting command bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
|
@ -38,7 +38,7 @@ pub enum Command {
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting db_remember_bot...");
|
||||
log::info!("Starting DB remember bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ impl Default for State {
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting dialogue_bot...");
|
||||
log::info!("Starting dialogue bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use teloxide::{
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting dispatching_features_bot...");
|
||||
log::info!("Starting dispatching features bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ use reqwest::{StatusCode, Url};
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting heroku_ping_pong_bot...");
|
||||
log::info!("Starting Heroku ping-pong bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ use teloxide::{
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting inline_bot...");
|
||||
log::info!("Starting inline bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ use teloxide::{dispatching::update_listeners::webhooks, prelude::*};
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting ngrok_ping_pong_bot...");
|
||||
log::info!("Starting ngrok ping-pong bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ static MESSAGES_TOTAL: Lazy<AtomicU64> = Lazy::new(AtomicU64::default);
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting shared_state_bot...");
|
||||
log::info!("Starting shared state bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ use teloxide::prelude::*;
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
pretty_env_logger::init();
|
||||
log::info!("Starting dices_bot...");
|
||||
log::info!("Starting throw dice bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 80 KiB |
Binary file not shown.
Before Width: | Height: | Size: 169 KiB |
Binary file not shown.
Before Width: | Height: | Size: 83 KiB |
1
media/command.gif.REMOVED.git-id
Normal file
1
media/command.gif.REMOVED.git-id
Normal file
|
@ -0,0 +1 @@
|
|||
ef2e4a5bb1648f3e9b630ff2cff7d8c153fbc32c
|
1
media/dialogue.gif.REMOVED.git-id
Normal file
1
media/dialogue.gif.REMOVED.git-id
Normal file
|
@ -0,0 +1 @@
|
|||
dd29622e00f4b6c1e00fd73f8d9a55985983c1bb
|
1
media/throw-dice.gif.REMOVED.git-id
Normal file
1
media/throw-dice.gif.REMOVED.git-id
Normal file
|
@ -0,0 +1 @@
|
|||
dec2620db8c3dea50deb4b561af6b3a981393b96
|
|
@ -39,7 +39,7 @@
|
|||
//! # #[tokio::main]
|
||||
//! # async fn main() {
|
||||
//! pretty_env_logger::init();
|
||||
//! log::info!("Starting shared_state_bot...");
|
||||
//! log::info!("Starting shared state bot...");
|
||||
//!
|
||||
//! let bot = Bot::from_env().auto_send();
|
||||
//!
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
//!
|
||||
//! For a high-level overview, see [our GitHub repository](https://github.com/teloxide/teloxide).
|
||||
//!
|
||||
//! ([Full](https://github.com/teloxide/teloxide/blob/master/examples/dices.rs))
|
||||
//! ([Full](https://github.com/teloxide/teloxide/blob/master/examples/throw_dice.rs))
|
||||
//! ```no_run
|
||||
//! use teloxide::prelude::*;
|
||||
//!
|
||||
//! # #[tokio::main]
|
||||
//! # async fn main() {
|
||||
//! pretty_env_logger::init();
|
||||
//! log::info!("Starting dices_bot...");
|
||||
//! log::info!("Starting throw dice bot...");
|
||||
//!
|
||||
//! let bot = Bot::from_env().auto_send();
|
||||
//!
|
||||
|
|
Loading…
Reference in a new issue