Updated dependencies
This commit is contained in:
@@ -6,13 +6,12 @@ pub async fn delete_message(
|
||||
q: CallbackQuery,
|
||||
locale: LocaleRef,
|
||||
) -> crate::Result<()> {
|
||||
if let Some(msg) = q.message {
|
||||
if bot.delete_message(msg.chat().id, msg.id()).await.is_err() {
|
||||
if let Some(msg) = q.message
|
||||
&& bot.delete_message(msg.chat().id, msg.id()).await.is_err() {
|
||||
bot.send_message(msg.chat().id, &locale.error_deleting_message)
|
||||
.reply_markup(deletion_markup(locale))
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
bot.answer_callback_query(q.id).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -46,6 +46,6 @@ async fn notify_about_no_user_info(
|
||||
}
|
||||
|
||||
/// Gets a handler that filters out the messages without user information
|
||||
pub fn get_handler() -> Handler<'static, DependencyMap, crate::Result<()>, DpHandlerDescription> {
|
||||
pub fn get_handler() -> Handler<'static, crate::Result<()>, DpHandlerDescription> {
|
||||
dptree::filter(has_no_user_info).endpoint(notify_about_no_user_info)
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ async fn notify_about_no_master_pass(
|
||||
}
|
||||
|
||||
/// Gets a handler that filters out the messages of users that don't have a master password set
|
||||
pub fn get_handler() -> Handler<'static, DependencyMap, crate::Result<()>, DpHandlerDescription> {
|
||||
pub fn get_handler() -> Handler<'static, crate::Result<()>, DpHandlerDescription> {
|
||||
dptree::filter_map_async(master_pass_exists).endpoint(notify_about_no_master_pass)
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ fn validate_document(document: Option<&Document>) -> Result<&Document, InvalidDo
|
||||
}
|
||||
|
||||
async fn download_file(bot: &Throttle<Bot>, file: &FileMeta) -> crate::Result<Box<[u8]>> {
|
||||
let path = bot.get_file(&file.id).await?.path;
|
||||
let path = bot.get_file(file.id.clone()).await?.path;
|
||||
let mut data = Vec::with_capacity(file.size as usize);
|
||||
let mut stream = bot.download_file_stream(&path);
|
||||
while let Some(bytes) = stream.try_next().await? {
|
||||
|
||||
Reference in New Issue
Block a user