Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Close() error
- func (c Client) PlainMessageText(msg string) string
- func (c Client) PostMessage(ctx context.Context, channelID, msg string) error
- func (c Client) ReceiveMessage(ctx context.Context, handler func(ctx context.Context, e *Event) error) error
- func (c *Client) RefreshUsersCache(ctx context.Context) error
- func (c Client) RespondToCommand(ctx context.Context, responseURL string, msg string, visible bool) error
- func (c Client) UploadImage(ctx context.Context, channels []string, ...) error
- func (c *Client) User(id string) (User, bool)
- func (c Client) Users(ctx context.Context) (map[string]User, error)
- func (c Client) UsersList(ctx context.Context) ([]User, error)
- type Event
- type EventType
- type Option
- type User
Constants ¶
View Source
const ( // AppMention is a Slack event type. // Subscribe to only the message events that mention your app or bot. AppMention = socketmode.AppMention // Message is a Slack event type. // A message was sent to a channel. Message = socketmode.Message // SlashCommand is a slash command. SlashCommand = socketmode.SlashCommand )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents a slack client.
func (Client) PlainMessageText ¶
PlainMessageText resolves meta tags of the message text and return it.
func (Client) PostMessage ¶
PostMessage sends a message to the Slack channel.
func (Client) ReceiveMessage ¶ added in v1.2.0
func (c Client) ReceiveMessage(ctx context.Context, handler func(ctx context.Context, e *Event) error) error
ReceiveMessage receives a message and passes it to a handler for processing.
func (*Client) RefreshUsersCache ¶ added in v1.3.0
RefreshUsersCache updates the client's cached user map.
func (Client) RespondToCommand ¶ added in v1.4.0
func (c Client) RespondToCommand(ctx context.Context, responseURL string, msg string, visible bool) error
RespondToCommand responds to the Slack command.
func (Client) UploadImage ¶
func (c Client) UploadImage(ctx context.Context, channels []string, title, fileName, fileType, comment string, img io.Reader) error
UploadImage uploads an image by files.upload API. see. https://api.slack.com/methods/files.upload
func (*Client) User ¶ added in v1.3.0
User returns the user corresponding to user ID from the client's user cache.
type Event ¶ added in v1.3.0
type Event = socketmode.Event
Event is an alias type of the socket mode event.
type EventType ¶ added in v1.4.0
type EventType = socketmode.EventType
EventType is the Slack event type.
Click to show internal directories.
Click to hide internal directories.