Lewati ke konten utama

API Reference

Internal HTTP bridge endpoints used by the Enigma web dashboard to communicate with the Discord.js bot process.

Di Discord:!en botinfo!en eval

Authentication & Base URL

The bot HTTP bridge listens on PORT (default http://127.0.0.1:3001). Requests originating outside loopback must supply the shared secret in the x-api-key request header matching BOT_API_KEY.

GET/internal/stats?guildId={guildId}
x-api-key

Returns live telemetry for a specific guild (member count, channel count, role count, active voice queues, and now-playing track). When guildId is omitted, returns process-wide totals.

{
  "name": "Enigma Community",
  "members": 128,
  "channels": 24,
  "roles": 15,
  "uptime": 86400000,
  "ping": 38,
  "memory": 67108864,
  "activeVoiceChannels": 1,
  "nowPlaying": null
}
GET/internal/commands
x-api-key

Lists all registered !en prefix commands in the bot process along with their category, usage string, cooldown, permission flags, and slash command availability.

[
  {
    "name": "warn",
    "description": "Issue a moderation warning to a server member",
    "category": "moderation",
    "aliases": [],
    "usage": "!en warn <@user> [reason]",
    "cooldown": "3s",
    "adminOnly": false,
    "modOnly": true,
    "ownerOnly": false,
    "hasSlash": true
  }
]
GET/internal/config?guildId={guildId}
x-api-key

Reads the active configuration for a guild, merging server-specific overrides with default prefix and auto-moderation rules.

{
  "prefix": "!en",
  "embedColor": "#18181b",
  "antiSpam": { "enabled": true },
  "antiLink": { "enabled": false },
  "antiCaps": { "enabled": false }
}
POST/internal/config
x-api-key

Updates a guild's configuration settings. Expects a JSON body containing guildId and a configPart object.

{
  "guildId": "000000000000000000",
  "configPart": {
    "prefix": "!en"
  }
}
POST/internal/send-embed
x-api-key

Sends a Discord message or rich embed constructed in the dashboard Embed Builder directly to a target text channel in the guild.

{
  "success": true,
  "messageId": "000000000000000000"
}