Struct TelegramChannel
pub struct TelegramChannel { /* private fields */ }Expand description
Telegram channel — long-polls the Bot API for updates
Implementations§
Source§impl TelegramChannel
impl TelegramChannel
pub fn new( bot_token: String, alias: impl Into<String>, peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync>, mention_only: bool, ) -> TelegramChannel
Sourcepub fn with_voice_peer_resolver(
self,
voice_peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync>,
) -> TelegramChannel
pub fn with_voice_peer_resolver( self, voice_peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync>, ) -> TelegramChannel
Set the resolver used to resolve voice-chat peers live (no cached state).
Sourcepub fn with_approval_timeout_secs(self, secs: u64) -> TelegramChannel
pub fn with_approval_timeout_secs(self, secs: u64) -> TelegramChannel
Override the approval prompt timeout (default 120s).
Sourcepub fn with_passive_group_context(self, enabled: bool) -> TelegramChannel
pub fn with_passive_group_context(self, enabled: bool) -> TelegramChannel
Record unaddressed group messages as passive context instead of dropping them.
Sourcepub fn with_ack_reactions(self, enabled: bool) -> TelegramChannel
pub fn with_ack_reactions(self, enabled: bool) -> TelegramChannel
Configure whether Telegram-native acknowledgement reactions are sent.
Sourcepub fn with_per_user_session(self, enabled: bool) -> TelegramChannel
pub fn with_per_user_session(self, enabled: bool) -> TelegramChannel
Set by the orchestrator from [channels.telegram.<alias>].per_user_session.
When false, group-chat messages carry ReplyTarget conversation scope,
so every member of a group (or forum topic) shares one session keyed on
the chat/topic. When true (default), group sessions stay sender-scoped.
Direct messages are always sender-scoped either way.
Sourcepub fn with_proxy_url(self, proxy_url: Option<String>) -> TelegramChannel
pub fn with_proxy_url(self, proxy_url: Option<String>) -> TelegramChannel
Set a per-channel proxy URL that overrides the global proxy config.
Sourcepub fn with_tool_command_specs(
self,
specs: Vec<(String, String)>,
) -> TelegramChannel
pub fn with_tool_command_specs( self, specs: Vec<(String, String)>, ) -> TelegramChannel
Store pre-computed tool command specs for bot command registration.
Sourcepub fn with_workspace_dir(self, dir: PathBuf) -> TelegramChannel
pub fn with_workspace_dir(self, dir: PathBuf) -> TelegramChannel
Configure workspace directory for saving downloaded attachments.
Sourcepub fn with_streaming(
self,
stream_mode: StreamMode,
draft_update_interval_ms: u64,
) -> TelegramChannel
pub fn with_streaming( self, stream_mode: StreamMode, draft_update_interval_ms: u64, ) -> TelegramChannel
Configure streaming mode for progressive draft updates or multi-message delivery.
Sourcepub fn with_api_base(self, api_base: String) -> TelegramChannel
pub fn with_api_base(self, api_base: String) -> TelegramChannel
Override the Telegram Bot API base URL. Useful for local Bot API servers or testing.
Sourcepub fn with_transcription(self, config: TranscriptionConfig) -> TelegramChannel
pub fn with_transcription(self, config: TranscriptionConfig) -> TelegramChannel
Configure voice transcription from a [transcription] snapshot.
Compatibility and test path. The daemon routes every channel through
with_transcription_manager with a manager built from live
config and the owning agent’s resolved provider; this path can only see
the legacy section, so it binds a lone registered provider and
otherwise leaves the choice unbound (see
transcription::manager_from_snapshot).
pub fn with_tts(self, config: &Config) -> TelegramChannel
Wire the daemon generation’s live-config authority for pairing writes.
Sourcepub async fn send_document(
&self,
chat_id: &str,
thread_id: Option<&str>,
file_path: &Path,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_document( &self, chat_id: &str, thread_id: Option<&str>, file_path: &Path, caption: Option<&str>, ) -> Result<(), Error>
Send a document/file to a Telegram chat
Sourcepub async fn send_document_bytes(
&self,
chat_id: &str,
thread_id: Option<&str>,
file_bytes: Vec<u8>,
file_name: &str,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_document_bytes( &self, chat_id: &str, thread_id: Option<&str>, file_bytes: Vec<u8>, file_name: &str, caption: Option<&str>, ) -> Result<(), Error>
Send a document from bytes (in-memory) to a Telegram chat
Sourcepub async fn send_photo(
&self,
chat_id: &str,
thread_id: Option<&str>,
file_path: &Path,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_photo( &self, chat_id: &str, thread_id: Option<&str>, file_path: &Path, caption: Option<&str>, ) -> Result<(), Error>
Send a photo to a Telegram chat
Sourcepub async fn send_photo_bytes(
&self,
chat_id: &str,
thread_id: Option<&str>,
file_bytes: Vec<u8>,
file_name: &str,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_photo_bytes( &self, chat_id: &str, thread_id: Option<&str>, file_bytes: Vec<u8>, file_name: &str, caption: Option<&str>, ) -> Result<(), Error>
Send a photo from bytes (in-memory) to a Telegram chat
Sourcepub async fn send_video(
&self,
chat_id: &str,
thread_id: Option<&str>,
file_path: &Path,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_video( &self, chat_id: &str, thread_id: Option<&str>, file_path: &Path, caption: Option<&str>, ) -> Result<(), Error>
Send a video to a Telegram chat
Sourcepub async fn send_audio(
&self,
chat_id: &str,
thread_id: Option<&str>,
file_path: &Path,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_audio( &self, chat_id: &str, thread_id: Option<&str>, file_path: &Path, caption: Option<&str>, ) -> Result<(), Error>
Send an audio file to a Telegram chat
Sourcepub async fn send_voice(
&self,
chat_id: &str,
thread_id: Option<&str>,
file_path: &Path,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_voice( &self, chat_id: &str, thread_id: Option<&str>, file_path: &Path, caption: Option<&str>, ) -> Result<(), Error>
Send a voice message to a Telegram chat
Sourcepub async fn send_document_by_url(
&self,
chat_id: &str,
thread_id: Option<&str>,
url: &str,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_document_by_url( &self, chat_id: &str, thread_id: Option<&str>, url: &str, caption: Option<&str>, ) -> Result<(), Error>
Send a file by URL (Telegram will download it)
Sourcepub async fn send_photo_by_url(
&self,
chat_id: &str,
thread_id: Option<&str>,
url: &str,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_photo_by_url( &self, chat_id: &str, thread_id: Option<&str>, url: &str, caption: Option<&str>, ) -> Result<(), Error>
Send a photo by URL (Telegram will download it)
Sourcepub async fn send_video_by_url(
&self,
chat_id: &str,
thread_id: Option<&str>,
url: &str,
caption: Option<&str>,
) -> Result<(), Error>
pub async fn send_video_by_url( &self, chat_id: &str, thread_id: Option<&str>, url: &str, caption: Option<&str>, ) -> Result<(), Error>
Send a video by URL (Telegram will download it)
Trait Implementations§
Source§impl Attributable for TelegramChannel
impl Attributable for TelegramChannel
fn role(&self) -> Role
fn alias(&self) -> &str
Source§fn tool_provenance(&self) -> ToolProvenance
fn tool_provenance(&self) -> ToolProvenance
Source§impl Channel for TelegramChannel
impl Channel for TelegramChannel
Source§fn self_addressed_mention(&self) -> Option<String>
fn self_addressed_mention(&self) -> Option<String>
Telegram users mention the bot as @bot_username in chat. The
cached bot_username from getMe is already the bare form;
prepend @ to match what arrives in inbound message text.
Source§fn request_approval<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
fn request_approval<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
Delegates to Self::request_approval_attributed and drops the
provenance, so the prompt/timeout logic lives in exactly one place.
Source§fn self_handle(&self) -> Option<String>
fn self_handle(&self) -> Option<String>
sender matches. A bot must never respond to its own messages, even
if a misconfigured peer group lists the bot’s handle as an external
peer. Read moreSource§fn supports_draft_updates(&self) -> bool
fn supports_draft_updates(&self) -> bool
Source§fn present_model_picker<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChannelModelPickerRequest,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
fn present_model_picker<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChannelModelPickerRequest,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
/model command. Read moreSource§fn supports_multi_message_streaming(&self) -> bool
fn supports_multi_message_streaming(&self) -> bool
Source§fn supports_turn_flush_narration(&self) -> bool
fn supports_turn_flush_narration(&self) -> bool
flush_draft_turn delivers each completed agent text turn as a permanent
outbound message, and the orchestrator therefore routes that narration
through the outbound hook + leak-detection boundary and orders it ahead of
the approval prompt via a flush barrier. Read moreSource§fn multi_message_delay_ms(&self) -> u64
fn multi_message_delay_ms(&self) -> u64
Source§fn send_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
fn send_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn update_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
TelegramChannel: 'async_trait,
fn update_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn flush_draft_turn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
TelegramChannel: 'async_trait,
fn flush_draft_turn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn discard_draft_turn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
TelegramChannel: 'async_trait,
fn discard_draft_turn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn update_draft_lifecycle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
event: ProgressEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
fn update_draft_lifecycle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
event: ProgressEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn finalize_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
text: &'life3 str,
suppress_voice: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
TelegramChannel: 'async_trait,
fn finalize_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
text: &'life3 str,
suppress_voice: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
TelegramChannel: 'async_trait,
suppress_voice forces text delivery even on voice-only peers. Read moreSource§fn cancel_draft<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
fn cancel_draft<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn listen<'life0, 'async_trait>(
&'life0 self,
tx: Sender<ChannelMessage>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
TelegramChannel: 'async_trait,
fn listen<'life0, 'async_trait>(
&'life0 self,
tx: Sender<ChannelMessage>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn listener_health(&self) -> Option<ListenerHealth>
fn listener_health(&self) -> Option<ListenerHealth>
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
TelegramChannel: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn start_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
fn start_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn stop_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
fn stop_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn request_approval_attributed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<AttributedApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
fn request_approval_attributed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<AttributedApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
Channel::request_approval, but also reports WHO produced the
decision: which back-channel answered (decided_by) and whether a person
answered at all (ApprovalSource). Read moreSource§fn request_approval_attributed_with_timeout<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
request: &'life2 ChannelApprovalRequest,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<AttributedApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
fn request_approval_attributed_with_timeout<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
request: &'life2 ChannelApprovalRequest,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<AttributedApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
TelegramChannel: 'async_trait,
Source§fn send_final<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn send_final<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn set_cancel_token(&self, _token: CancellationToken)
fn set_cancel_token(&self, _token: CancellationToken)
listen() is called.
Channels that internally wait for shutdown can subscribe instead of
independently catching SIGINT.Source§fn uses_cancel_token(&self) -> bool
fn uses_cancel_token(&self) -> bool
set_cancel_token. Only participating channels get
a bounded grace period for cleanup after cancellation.Source§fn send_choice<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
prompt: &'life2 str,
options: &'life3 [(String, String)],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn send_choice<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
prompt: &'life2 str,
options: &'life3 [(String, String)],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Source§fn supports_native_polls(&self) -> bool
fn supports_native_polls(&self) -> bool
Channel::send_poll.
Callers check this before offering one, so a channel without native
polls keeps whatever fallback the caller already had.Source§fn supports_outbound_send(&self) -> bool
fn supports_outbound_send(&self) -> bool
send actually delivers a message OUTBOUND on this channel. Default
true. An INBOUND-ONLY transport (e.g. an AMQP trigger source whose send is a
deliberate no-op that returns Ok) overrides this to false, so a surface that
must genuinely deliver - such as the SOP approval route adapter - can refuse to
route to it (and report the misconfiguration) instead of silently succeeding
without sending anything.Source§fn drop_self_messages(&self, msg: &ChannelMessage) -> bool
fn drop_self_messages(&self, msg: &ChannelMessage) -> bool
msg.sender against Self::self_handle case-insensitively after
stripping a leading @ from each side. Override only for platforms
whose identity comparison is non-string.fn forge_request<'life0, 'async_trait>(
&'life0 self,
_request: ForgeApiRequest,
) -> Pin<Box<dyn Future<Output = Result<ForgeApiResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn is_direct_message(&self, _msg: &ChannelMessage) -> bool
fn is_direct_message(&self, _msg: &ChannelMessage) -> bool
false: channels that cannot
prove a one-to-one context keep the classifier precheck.Source§fn multi_message_confirmed_offset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn multi_message_confirmed_offset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
update_draft have
already been emitted on the transport as paragraph messages (including
their trailing \n\n delimiters). Read moreSource§fn update_draft_progress<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn update_draft_progress<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Source§fn update_draft_progress_batch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
texts: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn update_draft_progress_batch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
texts: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Source§fn update_typed_draft_progress_batch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
progress: &'life3 [DraftProgress],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn update_typed_draft_progress_batch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
message_id: &'life2 str,
progress: &'life3 [DraftProgress],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Source§fn add_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn add_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Source§fn remove_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn remove_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Source§fn pin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn pin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn unpin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn unpin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn redact_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_reason: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn redact_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_reason: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn create_room<'life0, 'life1, 'async_trait>(
&'life0 self,
_options: &'life1 RoomCreationOptions,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn create_room<'life0, 'life1, 'async_trait>(
&'life0 self,
_options: &'life1 RoomCreationOptions,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn send_poll<'life0, 'life1, 'async_trait>(
&'life0 self,
_poll: &'life1 PollRequest,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn send_poll<'life0, 'life1, 'async_trait>(
&'life0 self,
_poll: &'life1 PollRequest,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn invite_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_room_id: &'life1 str,
_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn invite_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_room_id: &'life1 str,
_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn room_context(&self, _room_id: &str) -> Option<ChannelRoomContext>
fn room_context(&self, _room_id: &str) -> Option<ChannelRoomContext>
room_id, when the adapter can
provide it and the operator has opted the alias in. Read moreSource§fn send_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_prompt: &'life2 ChannelGatePrompt,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn send_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_prompt: &'life2 ChannelGatePrompt,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn finalize_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_reference: &'life1 str,
_outcome: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn finalize_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_reference: &'life1 str,
_outcome: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
outcome (e.g. “Approved by @user —
run resumed”), so a decided gate cannot be clicked again and the
decision is visible in place. reference is the same correlation key
the prompt was sent with. Best-effort: Ok(false) when this channel
has nothing to finalize (no native prompt, or the mapping was lost to a
restart) — the gate state itself is never affected.Source§fn request_choice<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_question: &'life1 str,
_choices: &'life2 [String],
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn request_choice<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_question: &'life1 str,
_choices: &'life2 [String],
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn request_multi_choice<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_question: &'life1 str,
_choices: &'life2 [String],
_min_items: usize,
_max_items: usize,
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn supports_free_form_ask(&self) -> bool
fn supports_free_form_ask(&self) -> bool
ask_user
questions via the standard send + listen flow. Channels that only
handle structured choices return false so callers fail fast with a
useful error instead of timing out on listen.Auto Trait Implementations§
impl !Freeze for TelegramChannel
impl !RefUnwindSafe for TelegramChannel
impl !UnwindSafe for TelegramChannel
impl Send for TelegramChannel
impl Sync for TelegramChannel
impl Unpin for TelegramChannel
impl UnsafeUnpin for TelegramChannel
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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