This commit is contained in:
Suguivy 2023-07-03 20:44:45 +02:00
parent 6e5a3ed94e
commit d5a6e2e38d
1 changed files with 4 additions and 3 deletions

View File

@ -16,18 +16,19 @@ async fn main() -> Result<()> {
register().await? register().await?
}; };
/*
let data = Data::default(); let data = Data::default();
let client = Mastodon::from(data); let client = Mastodon::from(data);
let statuses = client.statuses(&AccountId::new("user-id"), Default::default()).await.unwrap(); let statuses = client.statuses(&AccountId::new("user-id"), Default::default()).await.unwrap();
dbg!(statuses); dbg!(statuses);
/* */
match get_next_url() { match get_next_url() {
Some(url) => { Some(url) => {
post_image(&mastodon, &url).await; post_image(&mastodon, &url).await;
update_bio(&mastodon).await; update_bio(&mastodon).await;
}, },
None => post(&mastodon, "@Sugui@awoo.fai.st @MeDueleLaTeta@awoo.fai.st me quedé sin chicas").await None => post(&mastodon, "@Sugui@awoo.fai.st @MeDueleLaTeta@awoo.fai.st me quedé sin chicas").await
};*/ };
Ok(()) Ok(())
} }
@ -103,7 +104,7 @@ async fn fetch_url(url: String, file_name: String) -> Result<()> {
async fn register() -> Result<Mastodon> { async fn register() -> Result<Mastodon> {
let registration = Registration::new("https://awoo.fai.st") let registration = Registration::new("https://awoo.fai.st")
.client_name("sleeping-girls-bot") .client_name("sleeping-girls-bot")
.scopes(Scopes::all()) .scopes(Scopes::write(scopes::Write::Accounts))
.build() .build()
.await?; .await?;
let mastodon = cli::authenticate(registration).await?; let mastodon = cli::authenticate(registration).await?;