feat: add commentary

This commit is contained in:
2025-09-19 21:18:26 +03:00
parent 36270c7a3f
commit 7a9ef2c48c
8 changed files with 327 additions and 10 deletions

View File

@@ -2,10 +2,11 @@ use dotenv::dotenv;
use std::sync::Arc;
use teloxide::{Bot, prelude::Requester, respond, types::Message};
use tg_relay_rs::{
comments::{Comments, init_global_comments},
handlers::{InstagramHandler, SocialHandler},
telemetry::setup_logger,
};
use tracing::{error, info};
use tracing::{error, info, warn};
#[tokio::main]
async fn main() -> color_eyre::Result<()> {
@@ -13,6 +14,16 @@ async fn main() -> color_eyre::Result<()> {
color_eyre::install().expect("color-eyre install");
setup_logger();
let comments = Comments::load_from_file("comments.txt")
.await
.map_err(|e| {
warn!("failed to laod comments.txt: {}; using dummy comments", e);
e
})
.unwrap_or_else(|_| Comments::dummy());
init_global_comments(comments).expect("failed to initialize global comments");
let bot = Bot::from_env();
info!("bot starting");