pub struct MessageHandler { /* private fields */ }Expand description
Processes incoming Telegram messages and writes events to the correct loop’s events.jsonl.
Implementations§
Source§impl MessageHandler
impl MessageHandler
Sourcepub fn new(
state_manager: StateManager,
workspace_root: impl Into<PathBuf>,
) -> Self
pub fn new( state_manager: StateManager, workspace_root: impl Into<PathBuf>, ) -> Self
Create a new message handler rooted at the given workspace.
Sourcepub fn handle_message(
&self,
state: &mut TelegramState,
text: &str,
chat_id: i64,
reply_to_message_id: Option<i32>,
) -> TelegramResult<String>
pub fn handle_message( &self, state: &mut TelegramState, text: &str, chat_id: i64, reply_to_message_id: Option<i32>, ) -> TelegramResult<String>
Handle an incoming message from Telegram.
Determines target loop, classifies as response or guidance, and appends the appropriate event to the loop’s events.jsonl.
Returns the event topic that was written ("human.response" or "human.guidance").
Auto Trait Implementations§
impl Freeze for MessageHandler
impl RefUnwindSafe for MessageHandler
impl Send for MessageHandler
impl Sync for MessageHandler
impl Unpin for MessageHandler
impl UnwindSafe for MessageHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more