feat: add #NoTweet to skip toot from being tweeted

This commit is contained in:
VC
2023-11-21 13:27:37 +01:00
parent b1aed34f3c
commit cdf7dc70c1
3 changed files with 8 additions and 2 deletions

View File

@@ -36,6 +36,12 @@ pub async fn run(config: &Config) {
.unwrap_or_else(|e| panic!("Cannot get instance: {}", e));
for toot in timeline {
// detecting tag #NoTweet and skipping the toot
if toot.tags.iter().any(|f| &f.name == "notweet") {
continue;
}
// form tweet_content and strip everything useless in it
let Ok(mut tweet_content) = strip_everything(&toot.content, &toot.tags) else {
continue; // skip in case we cant strip something
};