Skip to content

Security ​

  • The bot token stays on the server. It is read from the convar discord_bot_token and never leaves the server. Use set, not setr: setr replicates the value to every client. The same goes for discord_webhook_<name> (see Common concepts → Secrets).
  • config.lua is server-only. It is not a shared script; only Config.Presence is sent to clients.
  • No client event can make the bot do anything. The only net event is a client asking for its own profile, rate-limited (see Events → Net events). The baseevents death events are only listened to while the death log is on.
  • The client profile is for display. Decide permissions on the server with HasRole(source, …); a client can claim whatever it likes.
  • Webhook urls are only accepted for Discord's hosts, in convars, Config.Logs.channels and the webhook exports.
  • Mentions are off by default. Nothing pings anyone unless a message sets mentions = true or its own allowed_mentions, so player-written text can never @everyone. EscapeMarkdown makes player text inert (no formatting, mentions or links). The chat bridge, the built-in logs and the status message escape player names and text.
  • Bare role names only resolve in your own guilds (main and Config.Guilds). A partner server the bot was invited to cannot grant "Admin" on yours by having a role with that name. See Guilds & discovery → Names.
  • The whitelist fails closed. A role it cannot resolve refuses every connection, and an unreachable Discord refuses too unless failOpen is on.
  • Slash command permissions are only a default. Server admins can change who sees a command in Discord. Check roles in the handler when a command is sensitive (see Slash commands → Who may use it).

Every resource can use the bot

Exports are callable by every resource on your server. That is the point, but it also means a resource you do not trust could ban through your bot. Give the bot only the Discord permissions you actually use, and keep its role below the roles it must never touch.