Slack Setup
Create a Slack App
- Go to api.slack.com/apps
- Click Create New App → From scratch
- Name:
NIKI(orNIKI ServerNamefor multi-server) - Select your workspace
- Click Create App
Enable Socket Mode
Socket Mode lets NIKI receive messages without a public URL.
- Left sidebar → Socket Mode
- Toggle Enable Socket Mode → ON
- Name the token:
niki-socket - Copy the App-Level Token (starts with
xapp-)
Add Bot Permissions
- Left sidebar → OAuth & Permissions
- Scroll to Bot Token Scopes
- Add these scopes:
chat:write- send messagesim:history- read DM historyim:read- access DMsim:write- send DMsapp_mentions:read- respond to @mentionsfiles:write- send images/files
Subscribe to Events
- Left sidebar → Event Subscriptions
- Toggle Enable Events → ON
- Expand Subscribe to bot events
- Add:
message.im- receive DMsapp_mention- receive @mentions
Install to Workspace
- Left sidebar → Install App
- Click Install to Workspace
- Authorize the permissions
- Copy the Bot User OAuth Token (starts with
xoxb-)
Configure NIKI
Add to ~/.niki/config.toml:
[notifications.slack]enabled = truebot_token = "xoxb-..."app_token = "xapp-..."send_to_dm = trueallowed_user_ids = ["U12345678"] # Your Slack member IDFind Your Slack Member ID
- Open Slack
- Click your profile picture → Profile
- Click More (three dots) → Copy member ID
Test It
niki daemon restartniki watch -- echo "Hello from NIKI"Then try DMing your bot on Slack!
Troubleshooting
”Package not found” error
pip install niki[slack]niki daemon restartBot doesn’t respond to DMs
- Check Socket Mode is enabled
- Check
message.imevent is subscribed - Check
im:historyscope is added - Reinstall app after adding scopes