feat: Add ability to set up API and REST URLs

This commit is contained in:
Kiril Kovachev 2025-05-08 00:21:29 +01:00
parent 2fcbe535b9
commit c22af9bedf
2 changed files with 3 additions and 3 deletions

View File

@ -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 = "{}"

View File

@ -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();
}
}