Make all examples just *.rs files

This commit is contained in:
Hirrolot 2022-02-02 03:54:00 +06:00
parent e92eef4a7c
commit 3b3f5f855f
27 changed files with 39 additions and 204 deletions

View file

@ -97,12 +97,19 @@ smart-default = "0.6.0"
rand = "0.8.3"
pretty_env_logger = "0.4.0"
lazy_static = "1.4.0"
anyhow = "1.0.52"
serde = "1"
serde_json = "1"
tokio = { version = "1.8", features = ["fs", "rt-multi-thread", "macros"] }
warp = "0.3.0"
reqwest = "0.10.4"
chrono = "0.4"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs", "-Znormalize-docs"]
rustc-args = ["--cfg", "dep_docsrs"]
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples=examples"]
[[test]]
name = "redis"
@ -113,3 +120,35 @@ required-features = ["redis-storage", "cbor-serializer", "bincode-serializer"]
name = "sqlite"
path = "tests/sqlite.rs"
required-features = ["sqlite-storage", "cbor-serializer", "bincode-serializer"]
[[example]]
name = "dialogue"
required-features = ["macros", "sqlite-storage"]
[[example]]
name = "sqlite_remember"
required-features = ["sqlite-storage", "bincode-serializer", "redis-storage", "macros"]
[[example]]
name = "simple_commands"
required-features = ["macros"]
[[example]]
name = "redis_remember"
required-features = ["redis-storage", "bincode-serializer", "macros"]
[[example]]
name = "inline"
required-features = ["macros"]
[[example]]
name = "buttons"
required-features = ["macros"]
[[example]]
name = "admin"
required-features = ["macros"]
[[example]]
name = "dispatching2_features"
required-features = ["macros"]

View file

@ -1,17 +0,0 @@
[package]
name = "admin_bot"
version = "0.1.0"
authors = ["p0lunin <dmytro.polunin@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
teloxide = { path = "../../", features = ["macros"] }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
chrono = "0.4"
[profile.release]
lto = true

View file

@ -1,11 +0,0 @@
[package]
name = "buttons"
version = "0.1.0"
edition = "2018"
[dependencies]
teloxide = { path = "../../", features = ["macros"] }
tokio = { version = "1.3", features = ["rt-multi-thread", "macros"] }
log = "0.4.8"
pretty_env_logger = "0.4.0"

View file

@ -1,20 +0,0 @@
[package]
name = "dialogue_bot"
version = "0.1.0"
authors = ["Temirkhan Myrzamadi <hirrolot@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
teloxide = { path = "../../", features = ["frunk", "macros", "sqlite-storage"] }
anyhow = "1.0.52"
serde = "1"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
log = "0.4.8"
pretty_env_logger = "0.4.0"
[profile.release]
lto = true

View file

@ -1,16 +0,0 @@
[package]
name = "dices_bot"
version = "0.1.0"
authors = ["Temirkhan Myrzamadi <hirrolot@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
teloxide = { path = "../../" }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
[profile.release]
lto = true

View file

@ -1,13 +0,0 @@
[package]
name = "dispatching2_features"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
teloxide = { path = "../../", features = ["macros"] }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
rand = "0.8.4"

View file

@ -1,19 +0,0 @@
[package]
name = "heroku_ping_pong_bot"
version = "0.1.0"
authors = ["Pedro Lopes <ordepi@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
teloxide = { path = "../../" }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
tokio-stream = "0.1.4"
# Used to setup a webhook
warp = "0.3.0"
reqwest = "0.10.4"
serde_json = "1.0.50"

View file

@ -1 +0,0 @@
web: ./target/release/heroku_ping_pong_bot

View file

@ -1,15 +0,0 @@
# Heroku example
This is an example project on how to deploy `webhook_ping_pong_bot` to heroku.
You will need to configure the buildpack for heroku. We will be using [Heroku rust buildpack](https://github.com/emk/heroku-buildpack-rust). Configuration was done by using `heroku` CLI.
If you're creating a new Heroku application, run this command inside example
```
heroku create --buildpack emk/rust
```
To set buildpack for existing applicaton:
```
heroku buildpacks:set emk/rust
```

View file

@ -1,13 +0,0 @@
[package]
name = "inline_bot"
version = "0.1.0"
authors = ["Colin Diener <colin@colind.me>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
teloxide = { path = "../../", features = ["macros"] }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }

View file

@ -1,19 +0,0 @@
[package]
name = "webhook_ping_pong_bot"
version = "0.1.0"
authors = ["Temirkhan Myrzamadi <hirrolot@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
teloxide = { path = "../../" }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
tokio-stream = "0.1.4"
# Used to setup a webhook
warp = "0.3.0"
reqwest = "0.10.4"
serde_json = "1.0.50"

View file

@ -1,16 +0,0 @@
[package]
name = "redis_remember_bot"
version = "0.1.0"
authors = ["Maximilian Siling <mouse-art@ya.ru>"]
edition = "2018"
[dependencies]
# You can also choose "cbor-serializer" or built-in JSON serializer
teloxide = { path = "../../", features = ["redis-storage", "bincode-serializer", "macros"] }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
serde = "1.0.104"
thiserror = "1.0.15"

View file

@ -1,15 +0,0 @@
[package]
name = "shared_state_bot"
version = "0.1.0"
authors = ["Temirkhan Myrzamadi <hirrolot@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
teloxide = { path = "../../" }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
tokio-stream = "0.1.3"
lazy_static = "1.4.0"

View file

@ -1,13 +0,0 @@
[package]
name = "simple_commands_bot"
version = "0.1.0"
authors = ["Temirkhan Myrzamadi <hirrolot@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
teloxide = { path = "../../", features = ["macros"] }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }

View file

@ -1,16 +0,0 @@
[package]
name = "sqlite_remember_bot"
version = "0.1.0"
authors = ["Maximilian Siling <mouse-art@ya.ru>", "Sergey Levitin <selevit@gmail.com>"]
edition = "2018"
[dependencies]
# You can also choose "cbor-serializer" or built-in JSON serializer
teloxide = { path = "../../", features = ["sqlite-storage", "bincode-serializer", "redis-storage", "macros"] }
log = "0.4.8"
pretty_env_logger = "0.4.0"
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
serde = "1.0.104"
thiserror = "1.0.15"