Something went wrong. Try again.
Rust Framework for building Bluesky Bots
Something went wrong. Try again.
1234567891011121314151617181920212223242526use amsel::*;
#[tokio::main]async fn main() -> Result<()> { let session = BskySession::new_from_env().await?; session.run(PingBot { counter: 0 }).await}
struct PingBot { counter: u64,}
impl SimpleFileCursorStore for PingBot {}
impl AmselBot for PingBot { async fn on_post(&mut self, post: BskyPost) -> Result<()> { if post.text.contains("!ping") { self.counter += 1; let msg = format!("Pong! #{}", self.counter); post.reply_text(msg).await?; } Ok(()) }
}