← ShinyForge · App API · OpenAPI Schema · Discord Setup

Discord Bot Setup

Discord Bot Setup for ShinyForge

The existing incoming webhook can only post to Discord. This feed needs a separate bot token that can read your chosen channel. ShinyForge already performs the read-only requests; you do not need to run a second bot program, and the bot may appear offline because no Discord Gateway connection is opened.

1. Open https://discord.com/developers/applications and create an application, for example **ShinyForge Reader**.

2. Open **Bot**, create the bot if prompted, and use **Reset Token** to get its bot token. Keep it private. This is not the application ID, client secret or incoming webhook URL.

3. Under the Bot page’s **Privileged Gateway Intents**, enable **Message Content Intent** so channel message text and embed fields can be read. Only enable the intent this feed needs. Larger/verified apps may require Discord approval for privileged access.

4. Use **OAuth2 → URL Generator** with the **bot** scope (or the equivalent Guild Install settings). Select **View Channels** and **Read Message History**, then open the generated installation link and select your server. This read-only feed does not need Administrator or Send Messages.

5. Check the target channel’s permission overrides: the bot must be able to View Channel and Read Message History there, including in a private channel. Do not grant access to unrelated private channels.

6. In Discord Settings → Advanced, enable **Developer Mode**. Right-click the desired channel and choose **Copy Channel ID**.

7. Sign in as **@Sjl101** at https://shinytracker.sjl101.co.uk (or your own installation address).

8. Open **Private Tools → Discord Feed → Connect Read-Only Bot**. Paste the bot token into the password field, enter the numeric channel ID, and choose **Verify & Connect**. This verifies the bot identity and channel access before saving the secret in the private server database. No restart is needed. Never paste the token into chat or an issue.

9. The feed reads up to 100 recent messages, extracts text and embed fields, filters error posts and remembers hidden messages. It never posts or deletes messages in Discord. **Hide** only removes the entry from this site's feed.

For unattended deployments, private environment variables DISCORD_BOT_TOKEN and DISCORD_CHANNEL_ID remain supported as a fallback. A connection saved through the owner form takes precedence.

Keep .env out of Git, screenshots and browser code. The server’s .gitignore already excludes it. If a token is exposed, reset it in Discord and reconnect using the owner form. Do not use a normal Discord user token or a self-bot. The incoming webhook shared earlier is not stored or used by this reader.

If no content appears: check bot membership, channel ID, channel permission overrides and Message Content Intent. Wrong tokens cause authentication failure; missing channel permissions cause access failure. If permission changes were made, allow 20 seconds before refreshing the feed. An empty feed can also mean all fetched posts were filtered as errors. This polls Discord’s REST API when the owner opens/refetches the page; it is not an embedded feed or an unlimited history archive.

Official references:

- Bot creation/token: https://github.com/discord/discord-api-docs/blob/main/developers/quick-start/getting-started.mdx

- Bot installation: https://github.com/discord/discord-api-docs/blob/main/developers/bots/overview.mdx

- Message endpoint permissions/content intent: https://github.com/discord/discord-api-docs/blob/main/developers/resources/message.mdx

- Permission reference: https://github.com/discord/discord-api-docs/blob/main/developers/topics/permissions.mdx