use thiserror::Error; pub type BotResult = Result; #[derive(Error, Debug)] pub enum BotError { #[error("Serenity Error: {0}")] SerenityError(#[from] serenity::Error), #[error("Sqlite Error: {0}")] Sqlite(#[from] rusqlite::Error), #[error("Missing Bot Token")] MissingToken, #[error("Minecraft Data Error: {0}")] MinecraftDataError(#[from] minecraft_data_rs::DataError), #[error("IO Error: {0}")] IOError(#[from] std::io::Error), #[error("{0}")] Msg(String), } impl From<&str> for BotError { fn from(s: &str) -> Self { Self::Msg(s.to_string()) } }