Configuration¶
This document describes all configurable aspects of Chat Guard and recommended practices for secure and reliable operation.
File: src/config.js¶
module.exports = {
Client_Token: "<discord-bot-token>",
MongoDB_ConnectURL: "<mongodb-connection-string>",
BotOwners: ["<discord-user-id>", "<optional-second-owner-id>"],
BotStatus: "Bot is online!",
};
Client_Token(required): Discord bot token. Treat as secret.MongoDB_ConnectURL(required): MongoDB connection string. TLS recommended.BotOwners(required): Array of user IDs with developer‑level access.BotStatus(optional): Presence text (e.g., Watching, default configured in code).
Server Policy (stored in MongoDB)¶
Chat Guard persists per‑server configuration and state in the ChatGuard collection. See Data Model for full schema. Key toggles:
CharacterLimit(boolean): enforces 500‑character limitInviteGuard(boolean): blocks Discord invites from non‑whitelisted sourcesLinkGuard(boolean): blocks generic external linksMassPingGuard(boolean): mitigates mass mentionsBadWordGuard(boolean): filters profanity listSpamGuard(boolean): blocks burst spam (≥7 messages in 5s)MuteDurationMinute(number): mute duration in minutes (default 60)FiltredWords(array): server‑specific filtered keywordsWhiteListMembers|Roles|Channels(arrays): bypass enforcementPunishLogChannelID(string): channel ID for moderation logs
Recommended Defaults¶
- Set
PunishLogChannelIDimmediately after onboarding. - Keep
MuteDurationMinutebetween 10–120 depending on server risk appetite. - Enable
InviteGuard,LinkGuard, andSpamGuardfor baseline hygiene. - Curate
FiltredWordsto capture community‑specific risks.
Permissions¶
The bot requires, at minimum: - Manage Messages - Moderate Members (for timeout/mute) - Read/Send Messages - Manage Channels (recommended)
Grant only permissions necessary for your policy posture.
Internationalization¶
The bot currently sets moment locale to tr for time formatting. If you need a different locale, adjust the locale initialization in src/commands.js.
Secrets Management¶
Do not commit tokens or connection strings. Use environment managers (e.g., Heroku config vars, GitHub Actions secrets) and inject into src/config.js during deployment, or refactor to load from environment variables.
Back to Docs Index · Next: Architecture → · See also: Commands