A Slack bot for Pomodoro timer notifications using slash commands. Users trigger timers with /pomodoro and receive scheduled reminders via chat.scheduleMessage, so reminders persist even if the bot restarts.
Visit api.slack.com/apps and select Create New App → From scratch. Name it "tomatobot" and select your workspace.
In your app settings:
- Go to Settings → Socket Mode → toggle ON
- Click Generate an App-Level Token
- Name it (e.g., "tomatobot-socket")
- Grant the
connections:writescope - Save the token (format:
xapp-...) — you'll need this to run the bot
In Features → Slash Commands:
- Click Create New Command
- Command:
/pomodoro - Short Description:
Start a pomodoro timer - Usage Hint:
[minutes] [description] - Save
In Features → OAuth & Permissions, under Scopes → Bot Token Scopes, add:
chat:writechat:write.publiccommands
Click Install to Workspace at the top of OAuth & Permissions, then authorize. Copy the Bot User OAuth Token (format: xoxb-...) — you'll need this to run the bot.
export SLACK_BOT_TOKEN=xoxb-...
export SLACK_APP_TOKEN=xapp-...go build -o tomatobot .SLACK_BOT_TOKEN=xoxb-... SLACK_APP_TOKEN=xapp-... ./tomatobotThe bot connects via WebSocket (no public URL required) and listens for /pomodoro slash commands.
/pomodoro— Starts a 25-minute timer/pomodoro 15— Starts a 15-minute timer/pomodoro 25 write report— Starts a 25-minute timer labeled "write report"/pomodoro write report— Starts a 25-minute timer labeled "write report"
The bot responds immediately with a confirmation and schedules a reminder message to be delivered after the timer expires.
The bot uses Slack's chat.scheduleMessage API to schedule reminders server-side. This means:
- Reminders are delivered even if the bot process restarts
- No background goroutines needed
- All state is managed by Slack's servers