mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-25 01:25:12 +01:00
Add Dispatcher::save_storage()
This commit is contained in:
parent
707e69fb27
commit
c69e685e00
1 changed files with 5 additions and 1 deletions
|
@ -50,6 +50,10 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn save_storage(&mut self) {
|
||||||
|
self.storage.save().await;
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn dispatch(&mut self, update: Update) -> DispatchResult {
|
pub async fn dispatch(&mut self, update: Update) -> DispatchResult {
|
||||||
let chat_id = match &update.kind {
|
let chat_id = match &update.kind {
|
||||||
UpdateKind::Message(msg) => private_chat_id!(msg),
|
UpdateKind::Message(msg) => private_chat_id!(msg),
|
||||||
|
@ -85,6 +89,6 @@ where
|
||||||
|
|
||||||
impl<'a, S, H> Drop for Dispatcher<'a, S, H> {
|
impl<'a, S, H> Drop for Dispatcher<'a, S, H> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// TODO: run self.storage.save()
|
// TODO: run self.save_storage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue