Commit graph

23 commits

Author SHA1 Message Date
Maybe Waffle
529a316b0f fixup tests and examples that use derive(BotCommands)
Former-commit-id: dc652da1ac
2022-10-05 10:11:50 +04:00
Hirrolot
53be9d0e92 Reorder parameters in the examples
In reordering the parameters, I stick the following principle: place parameters from least changing to most changing. Thus, we have config and bot right from the beginning, next a dialogue with a possible payload, and next updates such as messages, inline queries, etc. This principle is used in languages with a native support for currying, although in Rust people appear to order parameters arbitrarily, so this commit is mostly for the sake of consistency.


Former-commit-id: 5922984f6c
2022-10-03 17:54:06 +06:00
Hirrolot
05501015ee Stop using AutoSend in the examples and docs
Former-commit-id: 00efbe163a
2022-09-29 09:37:20 +06:00
Hirrolot
3dd8787f13 Adjust imports a little bit in examples/purchase.rs
Former-commit-id: a22c91df6c
2022-07-21 16:53:52 +06:00
Maybe Waffle
11231655c2 Move ctrlc handler enable function to DispatcherBuilder
This helps with consistency -- every setting is changed in builder.
Also `Self -> Self` function sometimes plays more nicely with borrowck.


Former-commit-id: dd4af30727
2022-07-21 13:32:05 +04:00
Hirrolot
411c851a2f Update the dispatching example explanation
Former-commit-id: bc8b86181f
2022-07-19 19:34:35 +06:00
Hirrolot
6331fe50cb Use #[default] for State::Start in dialogues
Former-commit-id: 14e9fd2197
2022-07-04 21:47:57 +06:00
Hirrolot
deb992c787 Deprecate teloxide::handler! in favour of dptree::case! 2022-04-27 15:16:34 +06:00
Hirrolot
51d00ec351 Move the dispatch schema to a function (examples/purchase.rs) 2022-04-26 20:50:55 +06:00
Hirrolot
e5aafe3245 Separate handlers in examples/purchase.rs 2022-04-25 19:20:47 +06:00
Hirrolot
df0d13c42b Add teloxide::filter_command 2022-04-25 19:16:05 +06:00
Hirrolot
7fc1f6f180 Update teloxide-core to v0.6.0 2022-04-25 18:44:27 +06:00
Hirrolot
52678b187c Simplify InlineKeyboardButton construction 2022-04-25 01:38:55 +06:00
Hirrolot
f555d1d2d3 Prettify examples/purchase.rs by a separate command handler 2022-04-25 01:30:01 +06:00
Hirrolot
c3d5ed9fb7 Use teloxide::handler! for command handling too 2022-04-25 01:23:05 +06:00
Hirrolot
fd31cba6d7 Restrict all purchase bot's commands by State::Start 2022-04-24 23:30:22 +06:00
Hirrolot
ae48a11b3f Use dialogue.chat_id() in examples/purchase.rs 2022-04-24 23:11:47 +06:00
Hirrolot
d7b6229516 Call dialogue.exit() after a successful purchase 2022-04-23 23:52:43 +06:00
Hirrolot
a514c845cb Simplify examples/purchase.rs by sharing filters 2022-04-23 22:56:45 +06:00
Hirrolot
bc0e9b19a4 ProductChosen => ReceiveProductChoice 2022-04-23 22:45:43 +06:00
Hirrolot
a60e19a8c2 Implement dialogue::enter 2022-04-23 00:11:27 +06:00
Hirrolot
4a4990e207 Update the FAQ 2022-04-22 23:50:19 +06:00
Hirrolot
96b8df4bdd Add examples/purchase.rs 2022-04-22 23:42:50 +06:00