pub struct DiscordMessenger { /* private fields */ }Expand description
Discord messenger using bot token
Implementations§
Trait Implementations§
Source§impl Messenger for DiscordMessenger
impl Messenger for DiscordMessenger
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,
channel_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,
channel_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 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
Source§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnect the messenger
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
Auto Trait Implementations§
impl Freeze for DiscordMessenger
impl !RefUnwindSafe for DiscordMessenger
impl Send for DiscordMessenger
impl Sync for DiscordMessenger
impl Unpin for DiscordMessenger
impl UnsafeUnpin for DiscordMessenger
impl !UnwindSafe for DiscordMessenger
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