pub struct TelegramMessenger { /* private fields */ }Expand description
Telegram messenger using bot API
Implementations§
Trait Implementations§
Source§impl Messenger for TelegramMessenger
impl Messenger for TelegramMessenger
Source§fn messenger_type(&self) -> &str
fn messenger_type(&self) -> &str
Get the messenger type (telegram, discord, signal, matrix, etc.)
Source§fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the messenger (connect, authenticate, etc.)
Source§fn send_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chat_id: &'life1 str,
content: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chat_id: &'life1 str,
content: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send a message to a recipient/channel
Source§fn send_message_with_options<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: SendOptions<'life1>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_message_with_options<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: SendOptions<'life1>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a message with additional options
Source§fn receive_messages<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_messages<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive pending messages (non-blocking poll)
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if the messenger is connected
Auto Trait Implementations§
impl Freeze for TelegramMessenger
impl !RefUnwindSafe for TelegramMessenger
impl Send for TelegramMessenger
impl Sync for TelegramMessenger
impl Unpin for TelegramMessenger
impl UnsafeUnpin for TelegramMessenger
impl !UnwindSafe for TelegramMessenger
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