amsel 0.1.0

Framework for building Bluesky Bots
Documentation
use crate::{BskyRecordRef, Result, utils::BskyBotUtils};
use bsky_sdk::BskyAgent;

pub struct BskyPost {
    base: atrium_api::app::bsky::feed::post::RecordData,
    reference: BskyRecordRef,
    pub agent: BskyAgent,
}

impl BskyPost {
    pub fn new(
        base: atrium_api::app::bsky::feed::post::RecordData,
        reference: BskyRecordRef,
        agent: BskyAgent,
    ) -> BskyPost {
        BskyPost {
            base,
            reference,
            agent,
        }
    }
    pub async fn reply_text(&self, text: String) -> Result<BskyRecordRef> {
        BskyBotUtils::create_record_post(&self.agent, text, Some(&self.reference)).await
    }
}

impl std::ops::Deref for BskyPost {
    type Target = atrium_api::app::bsky::feed::post::RecordData;

    fn deref(&self) -> &Self::Target {
        &self.base
    }
}