From c22af9bedfbce4129c680015c7a1b012d3a70c47 Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Thu, 8 May 2025 00:21:29 +0100 Subject: [PATCH] feat: Add ability to set up API and REST URLs --- mwbot.toml | 4 ++-- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mwbot.toml b/mwbot.toml index d1eb29b..54a392f 100644 --- a/mwbot.toml +++ b/mwbot.toml @@ -1,6 +1,6 @@ # Copy this to `~/.config/mwbot.toml`. -api_url = "https://en.wiktionary.org/w/api.php" -rest_url = "https://en.wiktionary.org/api/rest_v1" +api_url = "{}" +rest_url = "{}" [auth] username = "{}" diff --git a/src/main.rs b/src/main.rs index b621a8d..731fd4a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,7 +41,7 @@ fn setup(action: Action) -> Result<(), std::io::Error> { match action { Action::Run => {panic!();} Action::Setup { username, botpassword, oauth2_token, api_url, rest_url } => { - let filled_in_config = formatx!(config_template, username, botpassword, oauth2_token).unwrap(); + let filled_in_config = formatx!(config_template, api_url, rest_url, username, botpassword, oauth2_token).unwrap(); std::fs::write(shellexpand::tilde("~/.config/mwbot.toml").into_owned(), filled_in_config).unwrap(); } }