mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
Update dependencies and fix code for teloxide 0.16 and sentry 0.40
- Upgrade teloxide to 0.16, sentry to 0.40, and related crates - Update handler type signatures for teloxide 0.16 - Fix error mapping to use std::io::Error::other - Adjust RegisterRequestStatus match arm for new enum variant - Update Cargo.lock for new dependencies
This commit is contained in:
@@ -73,7 +73,7 @@ where
|
||||
if let Ok(v) = image_response {
|
||||
let data = v
|
||||
.bytes_stream()
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
|
||||
.map_err(std::io::Error::other)
|
||||
.into_async_read()
|
||||
.compat();
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ async fn _send_downloaded_file(
|
||||
|
||||
let data = response
|
||||
.bytes_stream()
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
|
||||
.map_err(std::io::Error::other)
|
||||
.into_async_read()
|
||||
.compat();
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ pub async fn message_handler(
|
||||
|
||||
pub fn get_manager_handler() -> Handler<
|
||||
'static,
|
||||
dptree::di::DependencyMap,
|
||||
Result<(), Box<dyn Error + Send + Sync>>,
|
||||
teloxide::dispatching::DpHandlerDescription,
|
||||
> {
|
||||
|
||||
@@ -83,6 +83,6 @@ pub async fn register(user_id: UserId, message_text: &str) -> RegisterStatus {
|
||||
username: bot_username,
|
||||
},
|
||||
RegisterRequestStatus::LimitExtended => RegisterStatus::LimitExtended,
|
||||
RegisterRequestStatus::UnknownError { .. } => RegisterStatus::RegisterFail,
|
||||
RegisterRequestStatus::UnknownError => RegisterStatus::RegisterFail,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,7 @@ use teloxide::prelude::*;
|
||||
|
||||
pub type BotHandlerInternal = Result<(), Box<dyn Error + Send + Sync>>;
|
||||
|
||||
type BotHandler = Handler<
|
||||
'static,
|
||||
dptree::di::DependencyMap,
|
||||
BotHandlerInternal,
|
||||
teloxide::dispatching::DpHandlerDescription,
|
||||
>;
|
||||
type BotHandler = Handler<'static, BotHandlerInternal, teloxide::dispatching::DpHandlerDescription>;
|
||||
|
||||
type BotCommands = Option<Vec<teloxide::types::BotCommand>>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user