Print available bots for telegram botfather

This commit is contained in:
Manuel Vögele
2024-01-12 16:43:30 +01:00
parent a2b9384d5d
commit 739c9d770b
4 changed files with 59 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ mod db;
mod error;
mod schema;
use std::env::args;
use std::time::Duration;
use std::{env, fs::File, io::BufReader, sync::Arc};
@@ -27,6 +28,7 @@ use teloxide::types::ChatId;
use teloxide::{adaptors::throttle::Limits, Bot};
use tokio::time::sleep;
use crate::bot::Command;
use crate::db::DbChat;
#[macro_use]
@@ -74,6 +76,12 @@ pub type Database = Arc<Mutex<SqliteConnection>>;
#[tokio::main(flavor = "current_thread")]
async fn main() {
if let Some(arg1) = args().nth(1) {
if arg1 == "commands" {
Command::print_commands();
return;
}
}
pretty_env_logger::init();
let config = Config::load().unwrap();
info!("Connecting to database {}", config.data_path);