add env config

This commit is contained in:
Akulij 2025-03-30 18:15:45 +08:00
parent 88395e0b40
commit 30fe746bfd

View File

@ -1,4 +1,11 @@
use teloxide::prelude::*; use teloxide::prelude::*;
use envconfig::Envconfig;
#[derive(Envconfig)]
struct Config {
#[envconfig(from = "BOT_TOKEN")]
pub bot_token: String,
}
#[tokio::main] #[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>>{ async fn main() -> Result<(), Box<dyn std::error::Error>>{