pub struct SlackClient { /* private fields */ }Expand description
Main Slack API client
This is the primary entry point for interacting with the Slack API. It provides access to all API endpoints through specialized API clients.
§Example
use slacko::{SlackClient, AuthConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = SlackClient::new(AuthConfig::oauth("xoxp-token"))?;
// Post a message
client.chat()
.post_message("C12345", "Hello!")
.await?;
// List channels
let channels = client.conversations()
.list()
.await?;
Ok(())
}Implementations§
Source§impl SlackClient
impl SlackClient
Sourcepub fn new(auth: AuthConfig) -> Result<Self>
pub fn new(auth: AuthConfig) -> Result<Self>
Sourcepub fn api(&self) -> ApiApi
pub fn api(&self) -> ApiApi
Get the API test client
Provides methods for testing the Slack API connection.
Sourcepub fn bots(&self) -> BotsApi
pub fn bots(&self) -> BotsApi
Get the Bots API client
Provides methods for getting information about bot users.
Sourcepub fn chat(&self) -> ChatApi
pub fn chat(&self) -> ChatApi
Get the Chat API client
Provides methods for posting, updating, and deleting messages.
Sourcepub fn conversations(&self) -> ConversationsApi
pub fn conversations(&self) -> ConversationsApi
Get the Conversations API client
Provides methods for managing channels, groups, and DMs.
Sourcepub fn users(&self) -> UsersApi
pub fn users(&self) -> UsersApi
Get the Users API client
Provides methods for retrieving user information.
Sourcepub fn files(&self) -> FilesApi
pub fn files(&self) -> FilesApi
Get the Files API client
Provides methods for uploading and managing files.
Sourcepub fn reactions(&self) -> ReactionsApi
pub fn reactions(&self) -> ReactionsApi
Get the Reactions API client
Provides methods for adding and removing emoji reactions.
Sourcepub fn search(&self) -> SearchApi
pub fn search(&self) -> SearchApi
Get the Search API client
Provides methods for searching messages and files.
Sourcepub fn team(&self) -> TeamApi
pub fn team(&self) -> TeamApi
Get the Team API client
Provides methods for retrieving team/workspace information.
Sourcepub fn rtm(&self) -> RtmApi
pub fn rtm(&self) -> RtmApi
Get the RTM API client
Provides methods for real-time messaging via WebSocket.
Sourcepub fn socket_mode(&self) -> SocketModeApi
pub fn socket_mode(&self) -> SocketModeApi
Get the Socket Mode API client
Provides methods for receiving events via WebSocket using Socket Mode. This is the modern alternative to RTM for receiving events. Note: Requires an app-level token (xapp-…).
Sourcepub fn auth(&self) -> AuthApi
pub fn auth(&self) -> AuthApi
Get the Auth API client
Provides methods for testing and managing authentication.
Sourcepub fn pins(&self) -> PinsApi
pub fn pins(&self) -> PinsApi
Get the Pins API client
Provides methods for pinning and unpinning messages.
Sourcepub fn reminders(&self) -> RemindersApi
pub fn reminders(&self) -> RemindersApi
Get the Reminders API client
Provides methods for creating and managing reminders.
Sourcepub fn dnd(&self) -> DndApi
pub fn dnd(&self) -> DndApi
Get the DND API client
Provides methods for Do Not Disturb settings.
Sourcepub fn emoji(&self) -> EmojiApi
pub fn emoji(&self) -> EmojiApi
Get the Emoji API client
Provides methods for listing custom emoji.
Sourcepub fn oauth(&self) -> OAuthApi
pub fn oauth(&self) -> OAuthApi
Get the OAuth v2 API client
Provides methods for OAuth token exchange and management. Use this for building public Slack apps with OAuth flows.
Sourcepub fn openid(&self) -> OpenIDApi
pub fn openid(&self) -> OpenIDApi
Get the OpenID Connect API client
Provides methods for OpenID Connect authentication flows. Use this for implementing Sign in with Slack and identity verification.
Sourcepub fn usergroups(&self) -> UsergroupsApi
pub fn usergroups(&self) -> UsergroupsApi
Get the Usergroups API client
Provides methods for managing user groups.
Sourcepub fn views(&self) -> ViewsApi
pub fn views(&self) -> ViewsApi
Get the Views API client
Provides methods for managing modals and App Home.
Sourcepub fn dialog(&self) -> DialogApi
pub fn dialog(&self) -> DialogApi
Get the Dialog API client (Legacy)
Provides methods for opening legacy dialogs.
Sourcepub fn bookmarks(&self) -> BookmarksApi
pub fn bookmarks(&self) -> BookmarksApi
Get the Bookmarks API client
Provides methods for managing channel bookmarks.
Sourcepub fn admin(&self) -> AdminApi
pub fn admin(&self) -> AdminApi
Get the Admin API client
Provides methods for Enterprise Grid administration.
Sourcepub fn apps(&self) -> AppsApi
pub fn apps(&self) -> AppsApi
Get the Apps API client
Provides methods for managing app configurations.
Sourcepub fn calls(&self) -> CallsApi
pub fn calls(&self) -> CallsApi
Get the Calls API client
Provides methods for Slack Calls integration.
Sourcepub fn workflows(&self) -> WorkflowsApi
pub fn workflows(&self) -> WorkflowsApi
Get the Workflows API client
Provides methods for Workflow Builder integrations.
Trait Implementations§
Source§impl Clone for SlackClient
impl Clone for SlackClient
Source§fn clone(&self) -> SlackClient
fn clone(&self) -> SlackClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more