From c51beb2bdad22466fb34a2a26c6251d880df80f0 Mon Sep 17 00:00:00 2001 From: Izzy Swart Date: Mon, 5 Jul 2021 19:14:37 -0700 Subject: [PATCH] Read bot token from config --- src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9cf453c..f477705 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,9 +66,7 @@ async fn main() -> Result<(), Box> { let mastodon = registration.create_access_token(token)?; let publisher = MastodonPublisher::new(mastodon); - let api = Arc::new(Api::new( - std::env::var("TELEGRAM_BOT_KEY").expect("bot key not present"), - )); + let api = Arc::new(Api::new(cfg.bot_token.clone())); let chat = get_chat_ref(api.clone(), None) .await