client

package
v0.0.0-...-4b959bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package client provides an authenticated Slack client wrapper.

Index

Constants

This section is empty.

Variables

View Source
var ErrEnterprise = fmt.Errorf("enterprise grid workspace restricts this API (token would be invalidated)")

ErrEnterprise is returned when a Slack API method is restricted on enterprise grid.

Functions

This section is empty.

Types

type Client

type Client struct {
	*slackapi.Client
	// contains filtered or unexported fields
}

Client wraps *slack.Client with token metadata for raw API calls.

func New

func New(token, cookie string, opts ...slackapi.Option) *Client

New creates an authenticated Slack client with optional cookie support. Extra slack.Option values (e.g. slackapi.OptionAPIURL for testing) are appended after the cookie transport option.

func (*Client) Cookie

func (c *Client) Cookie() string

Cookie returns the session cookie (empty for bot/user tokens).

func (*Client) Enterprise

func (c *Client) Enterprise() bool

Enterprise returns true for enterprise grid workspaces.

func (*Client) GetConversationHistory

GetConversationHistory overrides the embedded method to block on enterprise grid with session tokens.

func (*Client) GetConversationInfo

func (c *Client) GetConversationInfo(input *slackapi.GetConversationInfoInput) (*slackapi.Channel, error)

GetConversationInfo overrides the embedded method to block on enterprise grid with session tokens.

func (*Client) GetConversationsForUser

func (c *Client) GetConversationsForUser(params *slackapi.GetConversationsForUserParameters) ([]slackapi.Channel, string, error)

GetConversationsForUser overrides the embedded method to block on enterprise grid with session tokens.

func (*Client) HTTPDo

func (c *Client) HTTPDo(req *http.Request) (*http.Response, error)

HTTPDo executes a raw HTTP request with authentication headers set.

func (*Client) SetEnterprise

func (c *Client) SetEnterprise(v bool)

SetEnterprise marks this client as enterprise grid.

func (*Client) Token

func (c *Client) Token() string

Token returns the raw Slack token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL