Documentation
¶
Overview ¶
Package slack is tomo's Slack channel. It runs in socket mode, so there is no public request URL to host: an app-level token opens a websocket, events arrive over it, and each is acknowledged by its envelope id. Messages are sent with a bot token over the web API. Only allowlisted channels are served, and approvals render as Block Kit buttons.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Slack ¶
type Slack struct {
AppToken string // xapp-... , opens the socket
BotToken string // xoxb-... , posts messages
Allow []string // channel ids permitted to talk to the bot
BaseURL string // web API base, default https://slack.com/api
Client *http.Client
// Dial connects the socket. Nil uses websocket.Dial; tests override it.
Dial func(ctx context.Context, url string) (*websocket.Conn, error)
// contains filtered or unexported fields
}
Slack serves an allowlisted set of channels over a socket-mode connection.
Click to show internal directories.
Click to hide internal directories.