Print available bots for telegram botfather
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user