Discord Setup
This guide mirrors the internal Discord Integration Guide and walks you through creating a Discord application, inviting the ReportFlow bot, and verifying that messages from your clockout channels are flowing into the worker and commission engine.
1. Create the bot
Set up a Discord application and bot with the right intents.
2. Invite and link
Invite the bot to your server and link it to your tenant.
3. Configure channels
Choose which channels ReportFlow should monitor for clockouts.
1. Create your Discord application and bot
In the Discord Developer Portal create a new application for your agency (for example "ReportFlow - Agency Name"). Under the Bot tab add a bot user and enable the Message Content, Server Members, and Presence gateway intents. These match the recommendations in the internal Discord integration guide and allow the bot to read clockout messages, track who is online, and react to events in real time.
Copy the bot token and application ID—these map to the DISCORD_BOT_TOKEN and DISCORD_CLIENT_ID values in your environment. In production you will store these as encrypted secrets; in development they typically live in apps/bot/.env and your root .env. Never share these values publicly and rotate them if you suspect they have been exposed.
2. Invite the bot with correct permissions
From the OAuth2 URL generator in the Developer Portal, generate an invite link with the bot and applications.commands scopes. Grant the bot permissions to read messages, send messages, add reactions, read message history, and use slash commands. Invite it to the Discord server where your chatters clock out.
Once invited you should see the bot listed in your server members. At this stage it may appear offline until the bot process is running inside your ReportFlow deployment. When the bot connects, it begins listening to events and relaying clockout messages into the BullMQ queue for processing.
3. Link Discord servers to your tenant
ReportFlow uses a GuildTenantMapping table to bind Discord servers to organizations. In the dashboard, open the Discord page. You will see a list of servers where your logged-in user has administrator privileges, powered by the /api/discord/servers endpoint described in the Discord server automatic linking documentation.
Click Link server on the server you want to use for clockouts. This ensures all messages received from that guild are scoped to the correct tenant in the database and that multi-tenant row-level security is enforced for every clockout, commission, and report.
4. Prepare your clockout channel
Choose or create a dedicated text channel for clockouts (for example #clockouts). Ensure the bot has permission to read messages, add reactions, and post replies in this channel. Pin a template that explains the clockout format, transaction markers (lp, ls, lt), and TOTAL line so that every chatter follows a consistent structure.
When a chatter posts a clockout, ReportFlow validates that the declared TOTAL matches the sum of model lines and then runs fraud prevention checks to detect duplicate lp/ls/lt markers between shifts. If something is off, the bot replies with a detailed error or warning so your team can correct the message before it affects payouts.
Next steps
- Learn more about the bot architecture and queues in Discord Bot Setup.
- See a full breakdown of lp/ls/lt semantics in Clockout Message Format.
- Once messages are flowing, move on to Setting Up Commission Rules.