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:
2025-06-21 23:47:03 +02:00
parent 1d6d51eea6
commit a26186f2ad
7 changed files with 492 additions and 61 deletions

View File

@@ -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();

View File

@@ -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();

View File

@@ -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,
> {

View File

@@ -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,
}
}

View File

@@ -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>>;