Skip to content

Configuration

Jerad Berhow edited this page Oct 10, 2026 · 9 revisions

Configuration

PariahBot reads its environment from hom.env (not .env) in the bot's directory. deploy/setup.sh creates it from .env.example and fills in the first three values interactively.

DISCORD_TOKEN=your-bot-token
CLIENT_ID=your-application-id
GUILD_ID=your-test-server-id
LOG_CHANNEL_ID=
LOG_CHANNEL_SUCCESS_ID=
LOG_CHANNEL_ERROR_ID=
TWITCH_CLIENT_ID=
TWITCH_CLIENT_SECRET=
YOUTUBE_API_KEY=
INSTAGRAM_ACCESS_TOKEN=
INSTAGRAM_BUSINESS_ACCOUNT_ID=
DASHBOARD_PORT=
DISCORD_CLIENT_SECRET=
DASHBOARD_HOST=
DASHBOARD_PUBLIC_URL=

Keep this file private — it holds the bot token. It is gitignored, and should be mode 600 on a Linux host:

chmod 600 /opt/PariahBot/hom.env

Variables

Variable Required What it does
DISCORD_TOKEN Yes The bot token from the Developer Portal. If this leaks, reset it there immediately.
CLIENT_ID Yes The application ID. Used to register slash commands and to build the invite link.
GUILD_ID No Controls where commands register. Set → that one server only, instantly. Empty → globally, to every server the bot is in, taking up to an hour to propagate.
LOG_CHANNEL_ID No Mirrors the command audit log into this channel — both successes and failures, unless the two below override it.
LOG_CHANNEL_SUCCESS_ID No Send only successful commands here. Overrides LOG_CHANNEL_ID for successes.
LOG_CHANNEL_ERROR_ID No Send only failed commands here. Overrides LOG_CHANNEL_ID for failures.
TWITCH_CLIENT_ID No Twitch app Client ID. With TWITCH_CLIENT_SECRET, turns on Twitch live alerts. See Streamer-Alerts.
TWITCH_CLIENT_SECRET No Twitch app Client Secret. The app must be registered as Confidential. Treat it like the bot token.
DASHBOARD_PORT No Turns on the Admin-Dashboard on this port, on 127.0.0.1. Empty: off.
DISCORD_CLIENT_SECRET With the dashboard The application's OAuth2 Client Secret, for signing in to the dashboard with Discord. Treat it like the bot token.
DASHBOARD_HOST No The address the dashboard listens on. Default 127.0.0.1 (this machine only).
DASHBOARD_PUBLIC_URL No The address you open the dashboard at, if it isn't http://localhost:<port>. Its /auth/callback must be registered as an OAuth2 redirect.
YOUTUBE_API_KEY No YouTube Data API v3 key. Turns on YouTube live and upload alerts. Restrict it to that one API. See Streamer-Alerts.
INSTAGRAM_ACCESS_TOKEN No A Meta System User token that never expires. With INSTAGRAM_BUSINESS_ACCOUNT_ID, turns on Instagram post alerts. Treat it like the bot token. See Instagram-Alerts.
INSTAGRAM_BUSINESS_ACCOUNT_ID No The Instagram user ID of the host's own Business/Creator account (its Page's instagram_business_account, not the Page ID). See Instagram-Alerts.

The bot reads hom.env only at startup, so restart the service after changing anything here.

The audit log is always written to logs/commands.log regardless; the LOG_CHANNEL_* values only add a Discord mirror. The bot needs View Channel and Send Messages in whichever channels you point them at.

GUILD_ID: development vs production

This is the variable people get caught by, so it's worth being explicit:

While developing — set it to your test server's ID. Command changes appear the instant npm run deploy finishes, with no propagation delay.

In production across multiple servers — leave it empty. Commands register globally and appear in every server the bot joins.

Switching from guild-scoped to global has one trap: guild-scoped registrations do not disappear when you register globally, so the old test server ends up showing every command twice. Clear them first:

# from the bot directory, with GUILD_ID still set to the old server
node -e '
require("dotenv").config({ path: "hom.env" });
const { REST, Routes } = require("discord.js");
const rest = new REST().setToken(process.env.DISCORD_TOKEN);
rest.put(Routes.applicationGuildCommands(process.env.CLIENT_ID, process.env.GUILD_ID), { body: [] })
  .then(() => console.log("cleared guild commands"));
'

Then blank GUILD_ID and run npm run deploy.

What is not configured here

Almost everything else. Alert destinations, voice hubs, role menus, auto-delete rules, mod/member/streamer roles, captcha, honeypot, giveaways, the streamer list and where its alerts post, the followed Instagram accounts and their channel — all of it is set per server, through slash commands, and stored in the database rather than in environment variables. See Server Configuration.

That's deliberate: the bot runs in multiple servers from one process and one database, so per-server settings can't live in a single global config file.

Clone this wiki locally