feat(discord): Added /balance {give,set} commands

- Also, you cannot /answer to unpublished quest
- Also, changed /scoreboard to print name instead of mentioning
- Also, made --config an option, defaulting to "cfg/config.toml"
This commit is contained in:
Alexey 2025-12-15 13:26:37 +03:00
commit 4ba57b925a
6 changed files with 111 additions and 10 deletions

View file

@ -13,6 +13,8 @@ mod config;
mod account;
mod error;
const CONFIG_PATH: &str = "cfg/config.toml";
#[derive(Debug)]
struct Data {
pub config: Config,
@ -25,7 +27,7 @@ async fn main() {
dotenv().unwrap();
let cli = cli::Cli::parse();
let config = Config::load(cli.config.clone());
let config = Config::load(cli.config.clone().unwrap_or(CONFIG_PATH.into()));
let discord = config.discord_impl().unwrap_or_else(|_| {
config.init_impl().unwrap();
config.discord_impl().unwrap()
@ -44,6 +46,7 @@ async fn main() {
commands::answer::answer(),
commands::social::social(),
commands::account::scoreboard(),
commands::account::balance(),
],
..Default::default()
})