Conversations

Struct Conversations 

Source
pub struct Conversations {
    pub client: Client,
}

Fields§

§client: Client

Implementations§

Source§

impl Conversations

Source

pub async fn archive(&self) -> Result<Response<DndEndSchema>, ClientError>

This function performs a POST to the /conversations.archive endpoint.

Archives a conversation.

FROM: https://api.slack.com/methods/conversations.archive

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn close( &self, ) -> Result<Response<ConversationsCloseSuccessSchema>, ClientError>

This function performs a POST to the /conversations.close endpoint.

Closes a direct message or multi-person direct message.

FROM: https://api.slack.com/methods/conversations.close

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn create( &self, ) -> Result<Response<ConversationsInfoSuccessSchema>, ClientError>

This function performs a POST to the /conversations.create endpoint.

Initiates a public or private channel-based conversation

FROM: https://api.slack.com/methods/conversations.create

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn history( &self, channel: &str, latest: f64, oldest: f64, inclusive: bool, limit: i64, cursor: &str, ) -> Result<Response<ConversationsHistorySuccessSchema>, ClientError>

This function performs a GET to the /conversations.history endpoint.

Fetches a conversation’s history of messages and events.

FROM: https://api.slack.com/methods/conversations.history

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:history.
  • channel: &str – Conversation ID to fetch history for.
  • latest: f64 – End of time range of messages to include in results.
  • oldest: f64 – Start of time range of messages to include in results.
  • inclusive: bool – Include messages with latest or oldest timestamp in results only when either timestamp is specified.
  • limit: i64 – The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached.
  • cursor: &str – Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.
Source

pub async fn info( &self, channel: &str, include_locale: bool, include_num_members: bool, ) -> Result<Response<ConversationsInfoSuccessSchema>, ClientError>

This function performs a GET to the /conversations.info endpoint.

Retrieve information about a conversation.

FROM: https://api.slack.com/methods/conversations.info

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:read.
  • channel: &str – Conversation ID to learn more about.
  • include_locale: bool – Set this to true to receive the locale for this conversation. Defaults to false.
  • include_num_members: bool – Set to true to include the member count for the specified conversation. Defaults to false.
Source

pub async fn invite( &self, ) -> Result<Response<ConversationsInfoSuccessSchema>, ClientError>

This function performs a POST to the /conversations.invite endpoint.

Invites users to a channel.

FROM: https://api.slack.com/methods/conversations.invite

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn join( &self, ) -> Result<Response<ConversationsJoinSuccessSchema>, ClientError>

This function performs a POST to the /conversations.join endpoint.

Joins an existing conversation.

FROM: https://api.slack.com/methods/conversations.join

Parameters:

  • token: &str – Authentication token. Requires scope: channels:write.
Source

pub async fn kick(&self) -> Result<Response<DndEndSchema>, ClientError>

This function performs a POST to the /conversations.kick endpoint.

Removes a user from a conversation.

FROM: https://api.slack.com/methods/conversations.kick

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn leave( &self, ) -> Result<Response<ConversationsLeaveSuccessSchema>, ClientError>

This function performs a POST to the /conversations.leave endpoint.

Leaves a conversation.

FROM: https://api.slack.com/methods/conversations.leave

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn list( &self, exclude_archived: bool, types: &str, limit: i64, cursor: &str, ) -> Result<Response<ConversationsListSuccessSchema>, ClientError>

This function performs a GET to the /conversations.list endpoint.

Lists all channels in a Slack team.

FROM: https://api.slack.com/methods/conversations.list

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:read.
  • exclude_archived: bool – Set to true to exclude archived channels from the list.
  • types: &str – Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
  • limit: i64 – The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn’t been reached. Must be an integer no larger than 1000.
  • cursor: &str – Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.
Source

pub async fn mark(&self) -> Result<Response<DndEndSchema>, ClientError>

This function performs a POST to the /conversations.mark endpoint.

Sets the read cursor in a channel.

FROM: https://api.slack.com/methods/conversations.mark

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn member( &self, channel: &str, limit: i64, cursor: &str, ) -> Result<Response<ConversationsMembersSuccessSchema>, ClientError>

This function performs a GET to the /conversations.members endpoint.

Retrieve members of a conversation.

FROM: https://api.slack.com/methods/conversations.members

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:read.
  • channel: &str – ID of the conversation to retrieve members for.
  • limit: i64 – The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached.
  • cursor: &str – Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.
Source

pub async fn open( &self, ) -> Result<Response<ConversationsOpenSuccessSchema>, ClientError>

This function performs a POST to the /conversations.open endpoint.

Opens or resumes a direct message or multi-person direct message.

FROM: https://api.slack.com/methods/conversations.open

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn rename( &self, ) -> Result<Response<ConversationsInfoSuccessSchema>, ClientError>

This function performs a POST to the /conversations.rename endpoint.

Renames a conversation.

FROM: https://api.slack.com/methods/conversations.rename

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn replie( &self, channel: &str, ts: f64, latest: f64, oldest: f64, inclusive: bool, limit: i64, cursor: &str, ) -> Result<Response<ConversationsRepliesSuccessSchema>, ClientError>

This function performs a GET to the /conversations.replies endpoint.

Retrieve a thread of messages posted to a conversation

FROM: https://api.slack.com/methods/conversations.replies

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:history.
  • channel: &str – Conversation ID to fetch thread from.
  • ts: f64 – Unique identifier of a thread’s parent message. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message.
  • latest: f64 – End of time range of messages to include in results.
  • oldest: f64 – Start of time range of messages to include in results.
  • inclusive: bool – Include messages with latest or oldest timestamp in results only when either timestamp is specified.
  • limit: i64 – The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached.
  • cursor: &str – Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.
Source

pub async fn set_purpose( &self, ) -> Result<Response<ConversationsInfoSuccessSchema>, ClientError>

This function performs a POST to the /conversations.setPurpose endpoint.

Sets the purpose for a conversation.

FROM: https://api.slack.com/methods/conversations.setPurpose

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn set_topic( &self, ) -> Result<Response<ConversationsInfoSuccessSchema>, ClientError>

This function performs a POST to the /conversations.setTopic endpoint.

Sets the topic for a conversation.

FROM: https://api.slack.com/methods/conversations.setTopic

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.
Source

pub async fn unarchive(&self) -> Result<Response<DndEndSchema>, ClientError>

This function performs a POST to the /conversations.unarchive endpoint.

Reverses conversation archival.

FROM: https://api.slack.com/methods/conversations.unarchive

Parameters:

  • token: &str – Authentication token. Requires scope: conversations:write.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,