Security and daily use - Discord
Scope: account and project
The Discord configuration lives in two scopes. The account holds the default used by every one of the subscriber's projects. A project inherits it automatically, but for each event type it can explicitly choose its own channel or turn delivery off - independently of the rest of the account. There is also a platform scope, with no account attached: it only serves Dock's own internal-account projects.
Who has access
The screen requires the project-management permission, held by the developer, admin and owner roles (and superdeveloper for internal accounts).
How the token is stored
The bot token is encrypted in the database and never comes back to the form in plain text - leaving the field blank on save means 'keep what is there'. Channel IDs are not secrets, so they stay visible in the form.
Why the channel ID has a fixed shape
The panel only accepts a string of 17 to 20 digits. That is the shape of a Discord identifier (a snowflake), not free text - rejecting anything else at save time avoids the situation where an alert stays silent for weeks because someone pasted a channel name or a link instead of the raw ID.
Keeping the team from being flooded
Five event types mean five independent switches - split them across separate channels of the same server instead of routing everything to one place. A sudden error spike (error-spike) has an extra safeguard independent of this integration: checked every 15 minutes, sent for the same project at most once every few hours.
Rotating the token
A suspicion that a token has leaked is reason enough to invalidate it. In the Discord Developer Portal, under the Bot tab, there is a Reset Token button - it issues a new token and immediately invalidates the previous one. Paste the new token into DockRay and send a test: only then do you know the integration works again and the old token has really lost access.
When someone leaves the team
The bot token is not tied to any one person's login, so someone leaving the team does not invalidate it by itself. If that person managed the bot on the Discord server or had access to the Developer Portal, treat it as a suspected leak and rotate the token the way described above.