Files
pawctioneer-bot/src/bot_result.rs
2025-09-03 00:28:46 +00:00

18 lines
502 B
Rust

use teloxide::dispatching::DpHandlerDescription;
#[derive(thiserror::Error, Debug)]
pub enum BotError {
#[error("User visible error: {0}")]
UserVisibleError(String),
#[error(transparent)]
InternalError(#[from] anyhow::Error),
}
impl BotError {
pub fn user_visible(msg: impl Into<String>) -> Self {
Self::UserVisibleError(msg.into())
}
}
pub type BotResult<T = ()> = Result<T, BotError>;
pub type BotHandler = dptree::Handler<'static, BotResult, DpHandlerDescription>;