Commit graph

341 commits

Author SHA1 Message Date
Hirrolot
c017e59eb3 Update the examples 2022-01-26 15:51:51 +06:00
p0lunin
44f3a9e2a5 add dispatching2_features_bot example. 2022-01-12 15:45:01 +02:00
Maybe Waffle
85ef14867f Fix examples 2022-01-12 14:03:52 +03:00
Maybe Waffle
98855ecebe Update test_example.sh
- Remove BOM
- Fix shebang
- Do not run `cargo check` in parallel
  - `rustc` is good at utilizating cores by default
  - running `cargo check` in parallel messes up the output
2022-01-12 14:01:07 +03:00
p0lunin
7a9ae4fef6 update buttons_bot example 2022-01-12 12:41:19 +02:00
p0lunin
d7386a7dc1 remove old_dispatching feature, add prelude2 and repls2 modules 2022-01-06 14:50:59 +02:00
p0lunin
a8098350fc Merge branch 'dev' into dispatching2
# Conflicts:
#	Cargo.toml
#	examples/dialogue_bot/Cargo.toml
#	examples/inline_bot/src/main.rs
#	src/dispatching/mod.rs
#	src/lib.rs
2022-01-06 14:25:01 +02:00
p0lunin
ca1c1f3e33 update teloxide_macros dependency + update examples and tests using BotDialogue derive macro 2022-01-06 14:11:53 +02:00
p0lunin
d6e439b0cf update simple_commands_bot example 2022-01-06 14:04:09 +02:00
p0lunin
593dbc29f7 update shared_state_bot example 2022-01-06 13:59:50 +02:00
p0lunin
980aab5fd0 update redis_remember_bot example 2022-01-06 13:59:40 +02:00
p0lunin
0eb9314c71 update ngrok_bot example 2022-01-06 13:34:38 +02:00
p0lunin
9892096027 update inline_bot example 2022-01-06 13:30:27 +02:00
p0lunin
e0d2d141f0 update dices_bot example 2022-01-05 20:23:20 +02:00
p0lunin
18afd9a95e update heroku_ping_pong example 2022-01-05 20:20:02 +02:00
p0lunin
e2891d6d00 remove #[out()] attribute 2021-12-29 14:21:37 +02:00
p0lunin
72dfef4963 added DialogueState macro 2021-12-29 13:33:51 +02:00
p0lunin
6c0f1b9fc4 Added handler_factory.rs 2021-12-28 18:24:56 +02:00
p0lunin
600330f827 remove state.rs file 2021-12-27 17:23:37 +02:00
Hirrolot
2c2cfae0e0 Merge branch 'dispatching2' of https://github.com/teloxide/teloxide into dispatching2 2021-12-27 21:13:57 +06:00
Hirrolot
b253b7eec2 Don't define async fn run()
rustc now emits enough good compiler error messages for procedural macros such as `#[tokio::main]`.
2021-12-27 21:13:46 +06:00
p0lunin
50f37cf43b update dialogue_bot example 2021-12-27 17:12:31 +02:00
p0lunin
51d6a2e900 Update admin_bot example. 2021-12-26 19:59:32 +02:00
p0lunin
a644d0b6d2 added handler_ext.rs, updated dptree version 2021-12-26 16:55:24 +02:00
p0lunin
6959d1c928 added dialogues + updated sqlite_remember_bot example. 2021-12-15 13:46:32 +02:00
p0lunin
635c18142a 1. Bump futures to 0.3.15 version (Abortable::is_aborted()).
2. Fix simple_commands_bot example.
2021-12-11 13:11:25 +02:00
p0lunin
4752b22c43 1. Change feature dispatching2 -> old_dispatching.
2. Added command repls.
3. Added function BotCommand::ty() due to new restrictions in the command repls.
2021-12-11 12:46:44 +02:00
p0lunin
e53f9eb2b3 use new system in the dice example 2021-12-03 16:02:57 +02:00
Maybe Waffle
31e133493b Buttons: add inline support 2021-10-16 11:07:55 +03:00
Maybe Waffle
776e8be073 Buttons: propagete errors in callback_handler, handle messages without text
...and also remove needless copying
2021-10-16 10:33:39 +03:00
Maybe Waffle
7ae2d7efba Buttons: use better layout for buttons
Allow multiple buttons in a row, ie use

```text
a | b | c
d | e | f
    g
```

instead of

```text
a
b
c
d
e
f
g
```
2021-10-16 10:26:30 +03:00
Maybe Waffle
51fcc5151c Buttons: use message.chat.id, instead of passing it via callback data 2021-10-16 10:12:21 +03:00
Santo Cariotti
5bacb6d681 Fix typo for callback_handler 2021-10-13 09:19:27 +02:00
Santo Cariotti
d501c031ff Fix name for message handler 2021-10-12 21:56:49 +02:00
Santo Cariotti
296c851a11 Remove pub keywords 2021-10-12 21:55:36 +02:00
Santo Cariotti
e8b27ba749 Merge two source files into one 2021-10-12 21:53:41 +02:00
Santo Cariotti
52ce224b6c Use callbacks into a self function 2021-10-12 21:50:37 +02:00
Santo Cariotti
6f963c91e6 Remove async on make keyboard function 2021-10-12 21:34:19 +02:00
Santo Cariotti
24f141c452 Add example using the InlineKeyboardMarkup 2021-10-12 20:12:56 +02:00
Maybe Waffle
56e7b6feb2 Add auto-send to the list of default features 2021-10-10 14:47:21 +03:00
Hirrolot
2a6067fe94 Prepare for v0.5.2 2021-08-25 23:51:19 +06:00
Colin Diener
f5a7187295 Apply builder-pattern to second example result 2021-08-19 11:23:57 -07:00
Colin Diener
1bd47314be Remove dbg! macro in favour of log::error! macro 2021-08-19 11:05:56 -07:00
Colin Diener
43f8e73973 Remove superfluous struct 2021-08-19 11:03:53 -07:00
Colin Diener
f6ad066087 Clarify verbage from message to query 2021-08-19 11:00:58 -07:00
Colin Diener
93c8e00086 Remove unused dispatcher variable, Bot to AutoSend 2021-08-19 10:56:39 -07:00
Colin Diener
ea5b2df251 Include inline bot example 2021-08-18 21:54:32 -07:00
Waffle
18f88cc034 Update dialogue_bot example 2021-07-06 23:15:12 +03:00
Waffle
183486a044 Update heroku and ngrok examples 2021-07-06 15:10:22 +03:00
Waffle
30644ab162 Update admin_bot example 2021-07-05 22:16:29 +03:00
Waffle
c378d6ef4e Make StatefulListener::new a little more convinient
Remove `timeout_hint` from the `StatefulListener::new` function. This parameter
is confusing and is likely to be set to `None` in most cases.

Add a `StatefulListener::new_with_timeout_hint` parameter which is the same as
the old `StatefulListener::new`.
2021-06-25 17:24:31 +03:00
Waffle
76dee997e0 Fix webhook examples (support graceful shutdown) 2021-06-25 16:57:24 +03:00
Hirrolot
c3bcdca549 Don't use .send() in examples/simple_commands_bot 2021-05-20 21:37:53 +06:00
Temirkhan Myrzamadi
9b75378572 Fix the tests and examples 2021-03-28 08:20:35 +06:00
Hirrolot
8522759e68
Get ready for v0.4.0 (#347)
* Get ready for v0.4.0

* Export teloxide_macros as macros in lib.rs

* Use tokio v1.3 in README.md

* Return the feature 'macros' back

* Export teloxide_macros::teloxide in the prelude

* Document the 'macros' feature in README.md

* Update src/lib.rs

Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>

* Update src/prelude.rs

Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>

* Propagate features from teloxide-core

* teloxide-core = 0.2.1

* Fix CI

* Require teloxide-core/auto_send instead of teloxide/auto-send

* default-features = false (teloxide-core)

* Specify each teloxide-core feature separately

* Fix Cargo.toml

* JSON -> Json, CBOR -> Cbor

* Update Cargo.toml

Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>

Co-authored-by: Waffle Lapkin <waffle.lapkin@gmail.com>
2021-03-21 18:34:23 +06:00
Temirkhan Myrzamadi
86253edc92 Use Box<dyn Error + Send + Sync> in the examples 2021-03-19 17:58:22 +06:00
Temirkhan Myrzamadi
9a90148114 Fix examples/dialogue_bot 2021-03-18 01:56:41 +06:00
Temirkhan Myrzamadi
f0d4bc320b Fix examples/redis_remember_bot 2021-03-18 01:50:48 +06:00
Temirkhan Myrzamadi
b1e6bc84be Remove examples/sqlite_remember_bot/db.sqlite-journal 2021-03-15 20:23:44 +06:00
Temirkhan Myrzamadi
34a2eee1fa Apply review suggestions 2021-03-15 09:22:32 +06:00
Temirkhan Myrzamadi
1af0bfdcbc Fix the examples 2021-03-13 22:13:24 +06:00
Temirkhan Myrzamadi
30458ab724 Oops, push the examples too 2021-03-06 03:24:10 +06:00
Sergey Levitin
e456e525d8 Update authors of sqlite_remember_bot 2020-10-24 20:18:13 +03:00
Sergey Levitin
5bb5357183 Gardening + update docs 2020-10-24 20:05:48 +03:00
Sergey Levitin
ef2a3b36ae Add a bot example for SqliteStorage 2020-10-24 19:57:51 +03:00
Jaslo Ziska
eed1bbb0fc
Conditionally add teloxide-macros crate and reexport macros
This commit adds the feature "macros" which conditionally adds the
teloxide-macros crate and reexports its macros.

All (doc) tests using these macros are also conditionally enabled now.
Also change examples accordingly.

This commit solves https://github.com/teloxide/teloxide/issues/283
2020-10-02 20:43:26 +02:00
Temirkhan Myrzamadi
05e32336fa Add requests::respond 2020-08-02 13:08:43 +06:00
DCjanus
7b9f7e8690 fix example code 2020-08-02 12:11:09 +08:00
Temirkhan Myrzamadi
b3aa539c4d Download the master branch of teloxide-macros 2020-08-01 17:52:50 +06:00
Temirkhan Myrzamadi
e26c8b6e94
Merge pull request #243 from teloxide/feature/arbitrary-transition-result-types
Unpair TransitionOut from concrete Error type resolves #242
2020-08-01 16:14:26 +06:00
Temirkhan Myrzamadi
8b14fb5122 Download teloxide-macros from git in the examples 2020-08-01 16:07:01 +06:00
Temirkhan Myrzamadi
71414b812f
Update examples/README.md 2020-08-01 15:16:28 +06:00
Temirkhan Myrzamadi
90a65c0f9e
Update examples/README.md 2020-08-01 15:15:45 +06:00
Temirkhan Myrzamadi
1e7919455b Import lazy_static into examples/shared_state_bot 2020-07-31 21:49:22 +06:00
Temirkhan Myrzamadi
09d3db9f9b Fix Cargo.toml files in the examples 2020-07-31 21:43:28 +06:00
Temirkhan Myrzamadi
e2d536bc91 Update examples/dialogue_bot 2020-07-31 18:47:20 +06:00
Temirkhan Myrzamadi
7097dd4f34 'Insert here your bot's name' -> 'Your bot's name here' 2020-07-31 00:47:26 +06:00
Temirkhan Myrzamadi
90338f9bac Update examples/heroku_ping_pong_bot & ngrok 2020-07-31 00:38:37 +06:00
Temirkhan Myrzamadi
02c71f72cb Use the generic HandlerE in REPLs 2020-07-31 00:16:21 +06:00
Temirkhan Myrzamadi
c39586ef10 Add commands_repl 2020-07-30 20:07:46 +06:00
Temirkhan Myrzamadi
1989dcbe04 UpdateWithCx::send_dice -> answer_dice 2020-07-30 19:29:39 +06:00
Temirkhan Myrzamadi
c81ec1602a Remove repl from prelude 2020-07-30 19:25:56 +06:00
Temirkhan Myrzamadi
67af702a81 Use repl in examples/dices_bot 2020-07-30 19:07:58 +06:00
Temirkhan Myrzamadi
e74196a62f Replace examples/ping-pong-bot with examples/dices-bot 2020-07-29 16:02:37 +06:00
Temirkhan Myrzamadi
a6eac93043 Add UpdateWithCx::send_dice 2020-07-29 15:54:43 +06:00
Temirkhan Myrzamadi
2685123316 Remove #[derive(Default)] from StartState in examples/dialogue_bot 2020-07-28 23:37:26 +06:00
Temirkhan Myrzamadi
adce7a4773 Remove the smart-default dependency from examples/redis_remember_bot 2020-07-28 23:33:53 +06:00
Temirkhan Myrzamadi
bdd2ffad2a .unwrap() -> .expect(std::convert::Infallible) 2020-07-28 22:18:43 +06:00
Temirkhan Myrzamadi
a3c67f1838 Update examples/dialogue_bot 2020-07-28 21:00:44 +06:00
Temirkhan Myrzamadi
709fe18ade Use teloxide-macros v0.3.2 2020-07-27 02:42:08 +06:00
Temirkhan Myrzamadi
af2aa218e7 #[teloxide(transition)] -> #[teloxide(subtransition)] 2020-07-27 00:52:03 +06:00
Temirkhan Myrzamadi
38a1f470ad Use the default characters per line limit 2020-07-26 23:47:02 +06:00
Temirkhan Myrzamadi
f9c192aad0 Fix the docs 2020-07-26 23:37:56 +06:00
Temirkhan Myrzamadi
54a6bf440b Add an auxiliary parameter to (sub)transitions 2020-07-26 23:16:49 +06:00
Temirkhan Myrzamadi
6c93256c89 Fix examples/dialogue_bot/Cargo.toml 2020-07-26 15:04:20 +06:00
Temirkhan Myrzamadi
796f446a46 Add cfg to the whole up_state.rs 2020-07-26 14:58:55 +06:00
Andrei Orlov
a22f8c6045 Fix examples/dialogue_bot dependencies 2020-07-26 12:32:01 +04:00
Temirkhan Myrzamadi
477d8a67d3 Remove DialogueWithCx::unpack 2020-07-26 13:46:43 +06:00
Temirkhan Myrzamadi
19730fb923 Download frunk_core from github/Hirrolot 2020-07-26 13:41:17 +06:00
Temirkhan Myrzamadi
71f38bcb92 Small refinements 2020-07-26 13:18:29 +06:00
Temirkhan Myrzamadi
c7d97be8a8 Remove up! 2020-07-26 04:34:21 +06:00
Temirkhan Myrzamadi
0c688b2bd2 append_field<_, T2, _, _> -> T2::up 2020-07-26 04:09:57 +06:00
Temirkhan Myrzamadi
6e7b13dfcc Fix examples/dialogue_bot 2020-07-26 03:59:32 +06:00
Temirkhan Myrzamadi
a3faf0356e Fill the blank instead of a test in examples/dialogue_bot 2020-07-26 03:24:00 +06:00
Temirkhan Myrzamadi
094a95e8d8 Add append_field 2020-07-26 03:10:48 +06:00
Temirkhan Myrzamadi
bf114de249 A nicer approach to manage dialogues via #[derive(Transition)] + #[teloxide(transition)] 2020-07-25 22:37:58 +06:00
Temirkhan Myrzamadi
56be9a2c59 Use three dots instead of the exclamation in the examples 2020-07-25 19:46:05 +06:00
Temirkhan Myrzamadi
aa0b2c7d1e Update examples/redis_remember_bot 2020-07-25 02:02:40 +06:00
Temirkhan Myrzamadi
18b813c159 Unify TransitionIn with TransitionOut 2020-07-24 19:26:49 +06:00
Temirkhan Myrzamadi
701b89bf8f Fix examples/dialogue_bot/Cargo.toml 2020-07-24 18:35:50 +06:00
Temirkhan Myrzamadi
aec1abde62 Update examples/dialogue_bot 2020-07-24 18:31:00 +06:00
Temirkhan Myrzamadi
34633ad57b Refactor examples/dialogue_bot 2020-07-24 18:25:52 +06:00
Temirkhan Myrzamadi
008e8505c5 Add BotDialogue 2020-07-24 18:05:05 +06:00
Temirkhan Myrzamadi
e6534ac1b8 Download teloxide-macros from 'ponos' 2020-07-24 12:36:24 +06:00
Temirkhan Myrzamadi
462b42c526 Trying to compile examples/dialogue_bot... 2020-07-24 01:04:42 +06:00
Temirkhan Myrzamadi
f67d960d43 Make a test in examples/dialogue_bot 2020-07-23 21:40:36 +06:00
Temirkhan Myrzamadi
23aa260d68 Extract Bot from Arc 2020-07-17 16:04:25 +06:00
Temirkhan Myrzamadi
31ac9bd984 Show strongly typed behaviour in examples/simple_commands_bot 2020-07-07 01:20:09 +06:00
Temirkhan Myrzamadi
56dadfbb34 Return Arc<RedisServer> 2020-07-04 21:02:07 +06:00
Temirkhan Myrzamadi
33910864c7
Merge branch 'master' into redis 2020-07-04 20:34:07 +06:00
p0lunin
4ceb1253dd Merge branch 'master' of https://github.com/teloxide/teloxide into commands
 Conflicts:
	examples/admin_bot/src/main.rs
	examples/simple_commands_bot/src/main.rs
	src/dispatching/dispatcher_handler_rx_ext.rs
2020-07-03 20:11:25 +03:00
p0lunin
c61e3eb8d3 fix example 2020-07-03 20:00:05 +03:00
p0lunin
eb638e9ff5 parallelize test examples 2020-07-03 16:52:36 +03:00
p0lunin
e44f0786d8 revert test_examples.sh 2020-07-03 16:37:05 +03:00
p0lunin
8158cf7347 changed check of examples 2020-07-02 16:17:40 +03:00
Temirkhan Myrzamadi
9efacfeb59 Prettify redis_remember_bot 2020-07-01 19:46:28 +06:00
Temirkhan Myrzamadi
c0582e001d Remove redundant format! 2020-07-01 19:30:10 +06:00
Temirkhan Myrzamadi
03ab247262 Update redis_remember_bot 2020-07-01 19:25:10 +06:00
Temirkhan Myrzamadi
fb6156a3b9
Merge branch 'master' into redis 2020-07-01 18:53:39 +06:00
Temirkhan Myrzamadi
0ac679c443 Remove the frunk dependency 2020-07-01 18:52:53 +06:00
Temirkhan Myrzamadi
ee9166999a Remove a redundant import 2020-06-26 18:47:42 +06:00
Temirkhan Myrzamadi
37a0ac8ef8
Merge branch 'master' into redis 2020-06-26 18:42:17 +06:00
Temirkhan Myrzamadi
eabc77caab Remove wrap_dialogue! 2020-06-26 18:18:31 +06:00
p0lunin
e336221c7b updated simple_commands_bot example 2020-06-24 20:46:23 +03:00
p0lunin
33f92f9ea0 updated admin_command example 2020-06-24 20:43:21 +03:00
Temirkhan Myrzamadi
7a232a4c51
Merge branch 'master' into redis 2020-06-19 08:55:19 +03:00
Temirkhan Myrzamadi
0db3116939 Remove stupid comments 2020-06-01 18:09:49 +06:00
Temirkhan Myrzamadi
67a31a6437
Update README.md 2020-06-01 13:05:52 +06:00
Temirkhan Myrzamadi
4c4909f5fd webhook_ping_pong_bot -> ngrok_ping_pong_bot 2020-06-01 13:05:10 +06:00
Temirkhan Myrzamadi
d2f4194d80 Add <E> type parameter to TransitionIn 2020-05-26 17:20:57 +06:00
Temirkhan Myrzamadi
75baa88c7e Update all the examples 2020-05-26 16:42:04 +06:00
Temirkhan Myrzamadi
da1762039d A small fix in examples/dialogue_bot 2020-05-26 16:12:53 +06:00
Temirkhan Myrzamadi
a6144d7a26 Add UpdateWithCx::answer_str 2020-05-26 16:08:54 +06:00
Temirkhan Myrzamadi
7fc58421b0 Add dialogue::{TransitionIn, TransitionOut} 2020-05-26 15:35:28 +06:00
Temirkhan Myrzamadi
bf01d2bf8f Fix examples/dialogue_bot 2020-05-26 15:13:53 +06:00
Temirkhan Myrzamadi
f95826e9f8 Add DialogueWithCx::unpack 2020-05-26 15:05:22 +06:00
Temirkhan Myrzamadi
f3fb72d527 DispatcherHandlerCx -> UpdateWithCx, DialogueDispatcherHandler -> DialogueWithCx 2020-05-26 15:01:57 +06:00
Temirkhan Myrzamadi
0a3617892b Remove examples/guess_a_number_bot
We already have an example bot that demonstrates how to use dialogues (examples/dialogue_bot)
2020-05-26 14:28:25 +06:00
Temirkhan Myrzamadi
c83c4e14de Update examples/guess_a_number_bot 2020-05-25 00:14:49 +06:00
Temirkhan Myrzamadi
3ffb2c70fb Document the newest macros 2020-05-24 22:28:08 +06:00