slackclient

package module
v0.0.0-...-fd1d0dc Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

README

slackclient

Small Slack client library for matterircd/matterbridge, modelled on matterclient and matrixclient. Wraps slack-go/slack: token/cookie and password login, RTM connection, conversation/channel and user helpers, and message posting.

Documentation

Overview

Package slackclient is a small Slack client library used by matterircd (and usable by matterbridge), the equivalent of matterclient for Mattermost.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(cred Credentials) *Client

func (*Client) Connected

func (c *Client) Connected() bool

func (*Client) CurrentUserName

func (c *Client) CurrentUserName() string

func (*Client) Disconnect

func (c *Client) Disconnect() error

func (*Client) GetChannelName

func (c *Client) GetChannelName(channelID string) string

func (*Client) GetChannelUsers

func (c *Client) GetChannelUsers(channelID string) ([]*slack.User, error)

func (*Client) GetChannels

func (c *Client) GetChannels() []slack.Channel

func (*Client) GetConversations

func (c *Client) GetConversations() ([]slack.Channel, error)

func (*Client) GetMe

func (c *Client) GetMe() *slack.User

func (*Client) GetUser

func (c *Client) GetUser(userID string) *slack.User

func (*Client) GetUserFromMessage

func (c *Client) GetUserFromMessage(rmsg *slack.MessageEvent) (*slack.User, error)

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(userID string) (*slack.User, error)

func (*Client) GetUsers

func (c *Client) GetUsers() []slack.User

func (*Client) GetUsersInConversation

func (c *Client) GetUsersInConversation(channelID string) ([]string, error)

func (*Client) IncomingEvents

func (c *Client) IncomingEvents() <-chan slack.RTMEvent

func (*Client) InitUsers

func (c *Client) InitUsers()

func (*Client) Invite

func (c *Client) Invite(channelID, username string) error

func (*Client) IsChannelMember

func (c *Client) IsChannelMember(channelID string) bool

func (*Client) IsOwnMessageEcho

func (c *Client) IsOwnMessageEcho(userID, channelID, timestamp string) bool

func (*Client) JoinChannel

func (c *Client) JoinChannel(channelName string) (string, string, error)

func (*Client) Kick

func (c *Client) Kick(channelID, username string) error

func (*Client) LeaveChannel

func (c *Client) LeaveChannel(channelID string) error

func (*Client) Login

func (c *Client) Login() error

func (*Client) Logout

func (c *Client) Logout() error

func (*Client) PostMessage

func (c *Client) PostMessage(channelID, text string) (string, error)

func (*Client) SendDirectMessage

func (c *Client) SendDirectMessage(username, text string) (string, error)

func (*Client) SetLogAPICalls

func (c *Client) SetLogAPICalls(level string)

SetLogAPICalls sets the log level of the Slack API calls.

func (*Client) SetLogLevel

func (c *Client) SetLogLevel(level string)

SetLogLevel sets the log level of slackclient.

func (*Client) SetStatus

func (c *Client) SetStatus(status string) error

func (*Client) SetTopic

func (c *Client) SetTopic(channelID, text string) error

func (*Client) TeamDomain

func (c *Client) TeamDomain() string

func (*Client) TeamID

func (c *Client) TeamID() string

func (*Client) TeamName

func (c *Client) TeamName() string

func (*Client) Topic

func (c *Client) Topic(channelID string) string

func (*Client) UserID

func (c *Client) UserID() string

func (*Client) UserName

func (c *Client) UserName(id string) string

type Credentials

type Credentials struct {
	Login string
	Team  string
	Pass  string
	Token string
}

Jump to

Keyboard shortcuts

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