feat: add multi-account ability

This commit is contained in:
VC
2022-11-03 16:14:25 +01:00
parent 44ec3edfe2
commit dad49da090
11 changed files with 341 additions and 163 deletions

View File

@@ -65,7 +65,7 @@ pub fn build_basic_status(tweet: &Tweet) -> String {
/// Generic register function
/// As this function is supposed to be run only once, it will panic for every error it encounters
/// Most of this function is a direct copy/paste of the official `elefren` crate
pub fn register(host: &str) {
pub fn register(host: &str, screen_name: &str) {
let mut builder = App::builder();
builder
.client_name(Cow::from(env!("CARGO_PKG_NAME").to_string()))
@@ -100,7 +100,12 @@ pub fn register(host: &str) {
let toml = toml::to_string(&*mastodon).unwrap();
println!(
"Please insert the following block at the end of your configuration file:\n[mastodon]\n{}",
"Please insert the following block at the end of your configuration file:
\n[mastodon.{}]
\ntwitter_screen_name = \"{}\"
\n{}",
screen_name.to_lowercase(),
screen_name,
toml
);
}