slack

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package slack is the gateway's Slack channel adapter. It uses Socket Mode (an outbound websocket, no public inbound URL needed) via the slack-go SDK, kept isolated to this package (guarded by TestVendorSDKsOnlyInTheirAdapters). The user creates a Slack app with an app-level token (xapp-…, Socket Mode) and a bot token (xoxb-…), storing them in the global .env as SLACK_APP_TOKEN and SLACK_BOT_TOKEN.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel is a Slack Socket Mode connection.

func New

func New(appToken, botToken string) *Channel

New builds a Slack channel from an app-level token (Socket Mode) and a bot token (Web API for posting replies).

func (*Channel) Name

func (c *Channel) Name() string

Name returns the adapter identifier.

func (*Channel) Send

func (c *Channel) Send(ctx context.Context, conversation string, msg channels.Outbound) error

Send posts a reply to a channel or DM, splitting long text with the shared chunker so it goes through the same egress as every other channel.

func (*Channel) Start

func (c *Channel) Start(ctx context.Context, sink channels.Sink) error

Start runs the Socket Mode loop and forwards each user message as an Inbound until ctx is cancelled. socketmode reconnects internally; RunContext only returns on ctx cancellation or a fatal error.

Jump to

Keyboard shortcuts

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