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
Temirkhan Myrzamadi
a33bd7205c
Separate modules of examples/dialogue_bot
2020-05-24 18:55:13 +06:00
Temirkhan Myrzamadi
5b2fa285aa
Simplify examples/dialogue_bot
2020-05-24 18:42:40 +06:00
Temirkhan Myrzamadi
572d41fbf8
Extract FavouriteMusic into favourite_music.rs (examples/dialogue_bot)
2020-05-24 18:39:41 +06:00
Temirkhan Myrzamadi
c9393aa5d6
Prettify examples/dialogues_bot a little bit
2020-05-24 17:36:20 +06:00
Temirkhan Myrzamadi
01dc7a0d42
Improve wrap_dialogue!
2020-05-24 17:15:46 +06:00
Temirkhan Myrzamadi
6ff1800f12
Add auxiliary dialogues macros
2020-05-24 17:08:40 +06:00
Temirkhan Myrzamadi
963218bba0
Use a coproduct as a dialogue FSM
2020-05-24 14:19:46 +06:00
Temirkhan Myrzamadi
ddd94543d1
Update examples/dialogue_bot
2020-05-24 01:06:04 +06:00
Temirkhan Myrzamadi
267a1dd053
Add 'up' operations (examples/dialogue_bot)
2020-05-24 00:46:00 +06:00
Maximilian Siling
c58aa22f7b
Simpler example for Redis
2020-04-19 20:48:36 +03:00
Maximilian Siling
82d0958c91
Make Serializer a trait, so anyone can implement it
2020-04-19 20:09:00 +03:00
Temirkhan Myrzamadi
478e7038a6
Merge branch 'master' into redis
2020-04-19 19:27:03 +03:00
Maximilian Siling
a67d896d26
Don't reconnect to Redis every time
2020-04-19 19:24:24 +03:00
Maximilian Siling
798102a7d7
Add Redis storage & example bot using it
2020-04-19 18:31:23 +03:00
Pedro Lopes de Azevedo
f3e1b41a73
Added heroku_ping_pong_bot example
...
Altered webhook_ping_pong_bot to work when deployinh to heroku
2020-04-16 23:31:02 -03:00
Temirkhan Myrzamadi
72a30e6dd1
Fix examples/webhook_ping_pong_bot
2020-04-01 00:26:55 +06:00
Temirkhan Myrzamadi
b9301bb1d5
Merge branch 'master' into webhooks
2020-03-31 21:52:44 +06:00
Temirkhan Myrzamadi
46338c464f
Refactor error logging if Update is failed to parse
2020-03-31 21:41:00 +06:00
Temirkhan Myrzamadi
68904e3a5a
Fix ci.yml
2020-03-31 13:49:55 +06:00
Temirkhan Myrzamadi
3cd1ff9e02
Update README.md
2020-03-31 01:10:04 +06:00
Temirkhan Myrzamadi
51129f5d0f
Provide a webhook example instead of a library function
2020-03-31 00:57:19 +06:00
Temirkhan Myrzamadi
bc89fe7b01
Prettify the examples
2020-03-16 17:55:49 +06:00
GoldsteinE
fff1e55a58
Improve readability of dialogue_bot example
2020-03-10 15:05:48 +03:00
Maximilian Siling
ecb09659b3
Refactor Storage so operations can fail
2020-03-09 20:19:27 +03:00
Temirkhan Myrzamadi
23df2d0577
Add the 'let secret = cx.dialogue' binding
2020-03-09 16:08:11 +06:00
Temirkhan Myrzamadi
95d3e7ceae
Remove the excess check in guess-a-number-bot
2020-03-09 14:59:37 +06:00
Temirkhan Myrzamadi
ec7db5ec7b
Decompose guess-a-number-bot
2020-03-09 14:01:45 +06:00
Temirkhan Myrzamadi
2374b5c2d3
Add examples/shared_state_bot
2020-03-04 14:15:23 +06:00
Temirkhan Myrzamadi
fb6e295447
Fix the examples
2020-02-23 19:36:31 +06:00
p0lunin
1f1234c9bf
fixed examples
2020-02-23 14:18:21 +02:00
p0lunin
61f06a5e7a
fixed documentation
2020-02-22 22:53:11 +02:00
Temirkhan Myrzamadi
e0d0e22ea6
Fix a typo
2020-02-19 21:19:22 +06:00
Temirkhan Myrzamadi
332da2c3dd
Simplify .commands()
2020-02-19 16:05:01 +06:00
Temirkhan Myrzamadi
46b20f676e
Add DispatcherHandlerRxExt
2020-02-19 15:53:54 +06:00
Temirkhan Myrzamadi
d6d08bb501
Update README.md
2020-02-19 07:45:34 +06:00
Temirkhan Myrzamadi
9c67500d29
Update README.md
2020-02-19 05:17:40 +06:00
Temirkhan Myrzamadi
295a42b033
Update README.md
2020-02-19 05:13:47 +06:00
Temirkhan Myrzamadi
fa554a8252
Fixes
2020-02-19 04:54:41 +06:00
Temirkhan Myrzamadi
d23b226e86
Shutting up rustc
2020-02-18 05:55:43 +06:00
Temirkhan Myrzamadi
9eda683fc5
Make handlers accept streams
2020-02-18 04:19:16 +06:00
Temirkhan Myrzamadi
67a781fb20
Modify examples/simple_commands_bot
2020-02-14 04:35:36 +06:00
Temirkhan Myrzamadi
141ad17181
Refactor
2020-02-14 04:09:46 +06:00
Temirkhan Myrzamadi
8c5b1d3db0
Fix examples/simple_commands_bot
2020-02-14 03:48:26 +06:00
Temirkhan Myrzamadi
7a582256ef
Fix a typo in examples/simple_commands_bot
2020-02-14 03:26:46 +06:00
Temirkhan Myrzamadi
2147ba2048
Add examples/simple_commands_bot
2020-02-14 03:23:41 +06:00
Temirkhan Myrzamadi
027b80f19b
Add examples/guess_a_number_bot
2020-02-14 02:00:54 +06:00
Temirkhan Myrzamadi
dad05955d1
Add descriptions to examples/README.md
2020-02-14 01:59:02 +06:00
Temirkhan Myrzamadi
5278041927
Rename commands_bot -> admin_bot
2020-02-14 00:29:26 +06:00
Temirkhan Myrzamadi
b6cd019682
Add TODO to examples/commands_bot
2020-02-14 00:26:06 +06:00
Temirkhan Myrzamadi
e3a032abff
And again!
2020-02-14 00:23:42 +06:00
Temirkhan Myrzamadi
9f2aa741f7
SImplify examples/commands_bot for a little bit
2020-02-14 00:20:22 +06:00
Temirkhan Myrzamadi
fc36cf142a
Fix a typo in examples/dialogue_bot
2020-02-14 00:17:31 +06:00
Temirkhan Myrzamadi
fa5b725681
Add a description to examples/multiple_handlers_bot
2020-02-14 00:15:10 +06:00
Temirkhan Myrzamadi
5d0db21fca
Fix examples/commands_bot
2020-02-14 00:11:56 +06:00
Temirkhan Myrzamadi
34d44e5195
Add a description to examples/dialogue_bot
2020-02-13 23:38:05 +06:00
Temirkhan Myrzamadi
42e2f3fb42
Refactor
2020-02-13 23:23:22 +06:00
p0lunin
c9f811a311
fixed example and added documentation
2020-02-13 17:42:24 +02:00
Temirkhan Myrzamadi
726a46b5ab
Remove unnecessary dependencies
2020-02-13 20:21:23 +06:00
Temirkhan Myrzamadi
7a7254b8a1
Add BotBuilder
2020-02-13 20:12:24 +06:00
Temirkhan Myrzamadi
690fdd06b4
Add Bot::{from_env, from_env_with_client}
2020-02-13 18:36:12 +06:00
Temirkhan Myrzamadi
ad0e241195
Add examples/README.md
2020-02-13 14:57:47 +06:00
Temirkhan Myrzamadi
7cf6aaff90
Add multiple_handlers_bot
2020-02-13 14:55:46 +06:00
Temirkhan Myrzamadi
e9a62be453
Rename simple_dialogue -> dialogue_bot
2020-02-12 20:44:40 +06:00
p0lunin
6de0c24ed2
Merge remote-tracking branch 'origin/rework-dispatching' into rework-dispatching
2020-02-12 16:08:39 +02:00
p0lunin
4058126665
fixed example admin_bot
2020-02-12 16:08:15 +02:00
Temirkhan Myrzamadi
3aeb9c4295
Update examples/simple_dialogue
2020-02-12 16:56:58 +06:00
Temirkhan Myrzamadi
26d721d928
Add comments to examples/ping_pong_bot
2020-02-12 16:34:38 +06:00
Temirkhan Myrzamadi
8d71825511
Update the token
2020-02-12 15:56:14 +06:00
Temirkhan Myrzamadi
9cab5e45f3
Implement a type-safe finite automaton (examples/simple_dialogue)
2020-02-12 15:55:36 +06:00
Temirkhan Myrzamadi
dce662064f
Fix update_listeners
2020-02-12 04:50:10 +06:00
p0lunin
2a43678974
added example
2020-02-11 21:35:22 +02:00
Temirkhan Myrzamadi
4b0dea21f1
Hot fixes
2020-02-11 19:12:14 +06:00
Temirkhan Myrzamadi
d803d8197a
Add TODO (examples/simple_dialogue)
2020-02-11 16:58:32 +06:00
Temirkhan Myrzamadi
0ae2d975df
Add the state! macro
2020-02-11 04:04:57 +06:00
Temirkhan Myrzamadi
afb6677a1e
Rename User -> UserInfo in examples/simple_dialogue
2020-02-11 03:51:50 +06:00
Temirkhan Myrzamadi
9525414f8d
Simplify examples/simple_dialogue
2020-02-11 03:13:09 +06:00
Temirkhan Myrzamadi
bde4d09e5d
Add dialogue::{next, exit}
2020-02-11 02:54:08 +06:00
Temirkhan Myrzamadi
17de4840d7
Refactor
2020-02-04 21:38:25 +06:00
Temirkhan Myrzamadi
4002d8fbbc
Fix simple_fsm
2020-02-03 20:53:12 +06:00
Temirkhan Myrzamadi
32d607daa9
Fix ping-pong-bot
2020-02-03 01:12:36 +06:00
Temirkhan Myrzamadi
2c4102e2b3
Simplify building ReplyKeyboardMarkup
2020-02-03 00:54:11 +06:00
Temirkhan Myrzamadi
f436a0269b
Add lto=true to ping_pong_bot for releases
2020-02-02 22:44:48 +06:00
Temirkhan Myrzamadi
61d002b8d4
Refactor
2020-02-02 22:32:27 +06:00
Temirkhan Myrzamadi
603640c5c0
Simplify simple_fsm
2020-02-01 10:05:18 +06:00
Temirkhan Myrzamadi
1a6297747c
Add examples/simple_fsm
2020-01-30 04:54:40 +06:00
Temirkhan Myrzamadi
6d737dabb4
Remove the actual token
2020-01-30 00:14:30 +06:00
Temirkhan Myrzamadi
1d6a21acb0
Add teloxide::prelude
2020-01-30 00:11:52 +06:00
Temirkhan Myrzamadi
6f2abd10ef
Finally fix the error
2020-01-29 23:43:47 +06:00
Temirkhan Myrzamadi
27ae3e13cf
Trying to fix ping_pong_bot.rs
2020-01-29 21:08:18 +06:00
Temirkhan Myrzamadi
adbd17efaf
Fix Clippy
2020-01-19 19:54:45 +06:00
Temirkhan Myrzamadi
2b77087aac
Return examples/ping_pong_bot.rs back
2020-01-19 19:45:48 +06:00