Skip to content

Slack Setup

Create a Slack App

  1. Go to api.slack.com/apps
  2. Click Create New AppFrom scratch
  3. Name: NIKI (or NIKI ServerName for multi-server)
  4. Select your workspace
  5. Click Create App

Enable Socket Mode

Socket Mode lets NIKI receive messages without a public URL.

  1. Left sidebar → Socket Mode
  2. Toggle Enable Socket Mode → ON
  3. Name the token: niki-socket
  4. Copy the App-Level Token (starts with xapp-)

Add Bot Permissions

  1. Left sidebar → OAuth & Permissions
  2. Scroll to Bot Token Scopes
  3. Add these scopes:
    • chat:write - send messages
    • im:history - read DM history
    • im:read - access DMs
    • im:write - send DMs
    • app_mentions:read - respond to @mentions
    • files:write - send images/files

Subscribe to Events

  1. Left sidebar → Event Subscriptions
  2. Toggle Enable Events → ON
  3. Expand Subscribe to bot events
  4. Add:
    • message.im - receive DMs
    • app_mention - receive @mentions

Install to Workspace

  1. Left sidebar → Install App
  2. Click Install to Workspace
  3. Authorize the permissions
  4. Copy the Bot User OAuth Token (starts with xoxb-)

Configure NIKI

Add to ~/.niki/config.toml:

[notifications.slack]
enabled = true
bot_token = "xoxb-..."
app_token = "xapp-..."
send_to_dm = true
allowed_user_ids = ["U12345678"] # Your Slack member ID

Find Your Slack Member ID

  1. Open Slack
  2. Click your profile picture → Profile
  3. Click More (three dots) → Copy member ID

Test It

Terminal window
niki daemon restart
niki watch -- echo "Hello from NIKI"

Then try DMing your bot on Slack!

Troubleshooting

”Package not found” error

Terminal window
pip install niki[slack]
niki daemon restart

Bot doesn’t respond to DMs

  1. Check Socket Mode is enabled
  2. Check message.im event is subscribed
  3. Check im:history scope is added
  4. Reinstall app after adding scopes