mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-08 19:33:53 +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 {
|
||||
let chat_id = match &update.kind {
|
||||
UpdateKind::Message(msg) => private_chat_id!(msg),
|
||||
|
@ -85,6 +89,6 @@ where
|
|||
|
||||
impl<'a, S, H> Drop for Dispatcher<'a, S, H> {
|
||||
fn drop(&mut self) {
|
||||
// TODO: run self.storage.save()
|
||||
// TODO: run self.save_storage()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue