Skip to main content

MessengerProvider

Trait MessengerProvider 

Source
pub trait MessengerProvider: Send + Sync {
    // Required methods
    fn provider_name(&self) -> &'static str;
    fn get_chats<'life0, 'async_trait>(
        &'life0 self,
        params: GetChatsParams,
    ) -> Pin<Box<dyn Future<Output = Result<ProviderResult<MessengerChat>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_messages<'life0, 'async_trait>(
        &'life0 self,
        params: GetMessagesParams,
    ) -> Pin<Box<dyn Future<Output = Result<ProviderResult<MessengerMessage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search_messages<'life0, 'async_trait>(
        &'life0 self,
        params: SearchMessagesParams,
    ) -> Pin<Box<dyn Future<Output = Result<ProviderResult<MessengerMessage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_message<'life0, 'async_trait>(
        &'life0 self,
        params: SendMessageParams,
    ) -> Pin<Box<dyn Future<Output = Result<MessengerMessage>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Provider for team messenger systems.

Implementations include Slack.

Required Methods§

Source

fn provider_name(&self) -> &'static str

Get the provider name for logging (e.g. “slack”).

Source

fn get_chats<'life0, 'async_trait>( &'life0 self, params: GetChatsParams, ) -> Pin<Box<dyn Future<Output = Result<ProviderResult<MessengerChat>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get available chats, channels, groups, or DMs.

Source

fn get_messages<'life0, 'async_trait>( &'life0 self, params: GetMessagesParams, ) -> Pin<Box<dyn Future<Output = Result<ProviderResult<MessengerMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get message history for a specific chat.

Source

fn search_messages<'life0, 'async_trait>( &'life0 self, params: SearchMessagesParams, ) -> Pin<Box<dyn Future<Output = Result<ProviderResult<MessengerMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search messages across chats.

Source

fn send_message<'life0, 'async_trait>( &'life0 self, params: SendMessageParams, ) -> Pin<Box<dyn Future<Output = Result<MessengerMessage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a message to a chat or thread.

Implementors§