saysthbot-reborn/src/config.rs
senseab 56635e0e1b
Dev (#1)
* init

* bot framework done

* here and ready for orm

* might use sea-orm

* orm done

* use teloxide

* ready to go?

* 需要完成命令部分

* 需要完成:list_handler()

* 查询用户名应当以@开头

* use rustls to avoid segfault?

* postgresql ready

* inline query done

* list_handler

* flattern code

* test needed

* ready to build

* some bugs

* almost done

* ready to take off

Co-authored-by: senset <dummy@dummy.d>
2022-06-28 18:11:47 +08:00

20 lines
560 B
Rust

use clap::Parser;
const DEFAULT_DATABASE: &'static str = "sqlite:///saysthbot.db";
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
pub struct Args {
/// Enable debug mode
#[clap(short = 'D', long, value_parser, default_value_t = false)]
pub debug: bool,
/// Telegram bot token
#[clap(short, long, value_parser, env = "TGBOT_TOKEN")]
pub tgbot_token: String,
/// Database URI
#[clap(short, long, value_parser, env = "DATABASE_URI", default_value=DEFAULT_DATABASE)]
pub database_uri: String,
}