Browse documentation

Deploy a Slack bot in Socket Mode

Host a Bolt app for JavaScript or Python, configure the two Slack tokens, and verify a threaded reply to an app mention.

Configure the Slack app and both tokens

  1. Open Slack app settings and create an app in your test workspace, or open your existing app. Enable Socket Mode. Generate an app-level token with connections:write and save it as SLACK_APP_TOKEN in Bothosting Variables.
  2. In OAuth & Permissions, add the bot scopes app_mentions:read dan chat:write for the supplied example. Under Event Subscriptions, enable events and subscribe to the bot event app_mention.
  3. Install the app to your workspace. If you changed its scopes, reinstall it to grant the updated scopes. Copy the Bot User OAuth Token into SLACK_BOT_TOKEN in Variables.

Socket Mode delivers requests through the connection the bot opens to Slack. It works with workspace installations. Slack Marketplace distribution has separate requirements. Slack’s Socket Mode setup.

Choose a worker and add your project

On Slack bot hosting, select Node.js Socket Mode bot atau Python Socket Mode bot. Upload or connect your own project, or add the example files from Overview before your first start.

For a manual upload, download the Bolt for JavaScript archive atau Bolt for Python archive. Keep index.js di samping package.json and its lockfile, or main.py di samping requirements.txt, at the deployment root.

For an existing app, confirm it reads both environment variables and uses the Bolt Socket Mode receiver for your language. Bolt for JavaScript dan Bolt for Python.

Verify the reply in your workspace

  1. Stop the copy running on your computer if it uses the same installation. Start the hosted deployment and check Console for a Socket Mode startup message.
  2. Invite the Slack app to a test channel. Select it by name in an @ mention and send the message.
  3. Open the message thread. The example replies with “Your Slack bot is running.”

If the reply is missing, check which role each token has, confirm the event subscription, and verify the bot has permission to post. Troubleshoot a missing Slack reply.