telegram: Accept token as function parameter
This commit is contained in:
parent
c7dcef1cd1
commit
3f36019dbd
1 changed files with 1 additions and 2 deletions
|
@ -43,10 +43,9 @@ async fn answer(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
pub async fn main() {
|
pub async fn main(token: String) {
|
||||||
teloxide::enable_logging!();
|
teloxide::enable_logging!();
|
||||||
log::info!("Starting labadoor Telegram bot...");
|
log::info!("Starting labadoor Telegram bot...");
|
||||||
let token = std::env::var("TELEGRAM_TOKEN").expect("TELEGRAM_TOKEN not set");
|
|
||||||
let bot = Bot::new(token).auto_send();
|
let bot = Bot::new(token).auto_send();
|
||||||
let bot_name: String = "Labadoor Telegram bot".to_string();
|
let bot_name: String = "Labadoor Telegram bot".to_string();
|
||||||
teloxide::commands_repl(bot, bot_name, answer).await;
|
teloxide::commands_repl(bot, bot_name, answer).await;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue