Marketplace

Slack Bot

Other

Slack bot driver (Socket Mode).

togo-framework
bash
togo install togo-framework/bot-slack

Install

bash
togo install togo-framework/bot
togo install togo-framework/bot-slack

The Slack driver for togo's bot subsystem, built on slack-go in Socket Mode — no public webhook URL required, so it works from localhost and behind NAT. It dispatches each message to the bot command/message handlers you register once with bot.OnCommand / bot.OnMessage.

Configure

  1. Create a Slack app at api.slack.com/apps.
  2. Enable Socket Mode and generate an App-Level Token (xapp-…) with the connections:write scope.
  3. Add bot scopes (app_mentions:read, channels:history, chat:write, im:history) and install the app to your workspace to get the Bot Token (xoxb-…).
  4. Subscribe to the message.channels / message.im events.
  5. Set env:
    bash
    BOT_DRIVER=slack
    SLACK_APP_TOKEN=xapp-...
    SLACK_BOT_TOKEN=xoxb-...

Blank-import the driver next to the base:

go
import (
	_ "github.com/togo-framework/bot"
	_ "github.com/togo-framework/bot-slack"
)

m.Channel is the Slack channel ID; Service.Send(ctx, channel, msg) posts to it. The driver ignores bot messages and edits to avoid loops.

License

MIT © togo-framework


<div align="center"> <h3>Premium sponsors</h3> <p> <a href="https://id8media.com"><strong>ID8 Media</strong></a> &nbsp;·&nbsp; <a href="https://one-studio.co"><strong>One Studio</strong></a> </p> <p><sub>Support togo — <a href="https://github.com/sponsors/fadymondy">become a sponsor</a>.</sub></p> </div>