mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Use .setup_ctrlc_handler()
in the examples
This commit is contained in:
parent
f97d699f74
commit
3307a0915c
7 changed files with 7 additions and 3 deletions
|
@ -127,7 +127,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||
.branch(Update::filter_callback_query().endpoint(callback_handler))
|
||||
.branch(Update::filter_inline_query().endpoint(inline_query_handler));
|
||||
|
||||
DispatcherBuilder::new(bot, handler).build().dispatch().await;
|
||||
DispatcherBuilder::new(bot, handler).build().setup_ctrlc_handler().dispatch().await;
|
||||
|
||||
log::info!("Closing bot... Goodbye!");
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ async fn main() {
|
|||
)
|
||||
.dependencies(dptree::deps![InMemStorage::<State>::new()])
|
||||
.build()
|
||||
.setup_ctrlc_handler()
|
||||
.dispatch()
|
||||
.await;
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ async fn main() {
|
|||
"Error has occurred in the dispatcher",
|
||||
))
|
||||
.build()
|
||||
.setup_ctrlc_handler()
|
||||
.dispatch()
|
||||
.await;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ async fn main() {
|
|||
},
|
||||
));
|
||||
|
||||
DispatcherBuilder::new(bot, handler).build().dispatch().await;
|
||||
DispatcherBuilder::new(bot, handler).build().setup_ctrlc_handler().dispatch().await;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ async fn main() {
|
|||
DispatcherBuilder::new(bot, handler)
|
||||
.dependencies(dptree::deps![storage])
|
||||
.build()
|
||||
.setup_ctrlc_handler()
|
||||
.dispatch()
|
||||
.await;
|
||||
}
|
||||
|
|
|
@ -25,5 +25,5 @@ async fn main() {
|
|||
},
|
||||
));
|
||||
|
||||
DispatcherBuilder::new(bot, handler).build().dispatch().await;
|
||||
DispatcherBuilder::new(bot, handler).build().setup_ctrlc_handler().dispatch().await;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ async fn main() {
|
|||
DispatcherBuilder::new(bot, handler)
|
||||
.dependencies(dptree::deps![storage])
|
||||
.build()
|
||||
.setup_ctrlc_handler()
|
||||
.dispatch()
|
||||
.await;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue