Messages are posting as BOT instead of USER on Railway (but worked locally).
- The
as_user=Trueparameter is deprecated and can cause issues - With user tokens (xoxp-*), messages automatically post as the user
- This parameter was removed in the fix
Slack has two types of tokens:
- User Token (xoxp-*): Posts messages as the authenticated user ✅
- Bot Token (xoxb-*): Posts messages as the bot app ❌
If the app has Bot Token Scopes configured in Slack, it may default to bot tokens even when user scopes are requested.
After re-deploying, check the Railway logs when authenticating:
✅ Using USER token (messages will appear as user)
✅ User token starts with: xoxp-...
🔑 Sending with USER token: xoxp-...
✅ Message posted as USER
⚠️ WARNING: Using BOT token (user token not available)
⚠️ This means messages will post as BOT, not as USER
🔑 Sending with BOT token: xoxb-...
⚠️ Message posted as BOT (bot_id: ...)
Users who authenticated before the fix need to re-authenticate:
- Go to your Railway app URL
- Click "Logout & Clear Data"
- Authenticate again with "Connect Slack Workspace"
If still posting as bot, verify your Slack App configuration at https://api.slack.com/apps:
-
OAuth & Permissions page:
-
User Token Scopes should have:
channels:readchat:writegroups:readusers:read
-
Bot Token Scopes should be EMPTY or minimal
- If bot scopes include
chat:write, Slack may prioritize bot token - Consider removing bot scopes entirely
- If bot scopes include
-
-
App Manifest (Settings > App Manifest):
oauth_config: scopes: user: - channels:read - chat:write - groups:read - users:read # bot: [] # Leave empty or remove
Ensure Railway has the same Slack app credentials as local:
SLACK_CLIENT_IDSLACK_CLIENT_SECRET- Both should match the app at api.slack.com/apps
xoxp-*= User token (posts as user) ✅xoxb-*= Bot token (posts as bot) ❌xoxa-*= App-level tokenxoxr-*= Refresh token
Use the test interface with ?dev=true:
https://your-railway-app.railway.app/test?dev=true
Check logs for token type when sending messages.