slack

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package slack is the Slack adapter for botbooter, connecting via Socket Mode.

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingConfig = errors.New("slack: missing required config field")

ErrMissingConfig is returned by New when a required Config field is empty.

Functions

func Client added in v0.2.0

func Client(b *core.Bot) *slackapi.Client

Client returns the Slack Web API client backing b, or nil if b is not a Slack bot.

func New

func New(cfg Config) (*core.Bot, error)

New creates a Slack bot that connects via Socket Mode. It returns ErrMissingConfig if a required Config field is missing.

func RawEvent added in v0.2.0

func RawEvent(m *core.Message) (*slackevents.MessageEvent, bool)

RawEvent returns the raw Slack message event carried on m, reporting whether m originated from Slack.

func RawReaction added in v0.4.0

func RawReaction(r *core.Reaction) (*slackevents.ReactionAddedEvent, bool)

RawReaction returns the raw Slack reaction event carried on r, reporting whether r originated from Slack.

func SocketClient added in v0.2.0

func SocketClient(b *core.Bot) *socketmode.Client

SocketClient returns the Socket Mode client backing b, or nil if b is not a Slack bot.

Types

type Config added in v0.3.0

type Config struct {
	// AppToken is the app-level token (starts "xapp-") that authorizes Socket Mode.
	AppToken string
	// BotToken is the bot-user OAuth token (starts "xoxb-") for Web API calls.
	BotToken string
}

Config configures a Slack bot connecting via Socket Mode.

Jump to

Keyboard shortcuts

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