Skip to content

Migrate to manifest v2 + adopt plugin settings #1

Description

@DeadIndian

Add plugin settings + dashboard integration

ADB core now supports plugin-exposed settings in the admin dashboard: a per-plugin settings page (auto-rendered from a schema), per-command enable/role permissions, and optional plugin-hosted web UIs. See CREATE-PLUGIN.mdPlugin Settings and Plugin Dependencies in the main repo.

This plugin should adopt it so server admins can configure it from the dashboard instead of only slash commands.

⚠️ This plugin is still on manifest v1

Before adding settings, migrate the manifest to v2. Add these fields:

"manifestVersion": 2,
"process": { "model": "pooled", "maxExecutionMs": 5000, "memoryMb": 128, "persistentReason": null },
"capabilities": { "storage": ["own-collection"], "discord": [/* your flags */], "hooks": ["subscribe"] },
"permissions": {
  "storage": ["own-collection"],
  "discord": [/* same flags */],
  "hooks": ["subscribe"],
  "network": { "outbound": [] },
  "filesystem": { "read": [], "write": [] },
  "childProcess": false,
  "nativeAddons": false
}

Replace the old top-level "permissions": ["db.read", ...] array with the object form above. Keep configSchema for backward compatibility.

1. Add the engines block

Declares the core + administration-plugin versions this plugin needs. The settings/webUi features require administration >=2.0.0; if it's older, the plugin refuses to load with a clear error instead of a dead settings page.

"engines": {
  "core": ">=2.0.0",
  "plugins": {
    "administration": ">=2.0.0"
  }
}

2. Add the settings block

Auto-renders a settings form in the dashboard sidebar. commandPermissions: true also adds a per-command enable/role table.

"settings": {
  "commandPermissions": true,
  "schema": [
    {
      "key": "creationChannelId",
      "type": "channel",
      "label": "Join-to-create channel"
    },
    {
      "key": "categoryId",
      "type": "string",
      "label": "Temp VC category ID"
    },
    {
      "key": "nameTemplate",
      "type": "string",
      "label": "Channel name template"
    },
    {
      "key": "autoDeleteDelay",
      "type": "number",
      "label": "Auto-delete delay (seconds)"
    },
    {
      "key": "maxChannels",
      "type": "number",
      "label": "Max temp channels"
    },
    {
      "key": "bitrateDefault",
      "type": "number",
      "label": "Default bitrate"
    },
    {
      "key": "userLimitDefault",
      "type": "number",
      "label": "Default user limit"
    }
  ]
}

Field types: string, number, boolean, channel, role, select (needs options). Adjust the suggested schema above to match your actual config keys.

3. Read the saved config in your plugin

const cfg = await ctx.db.getPluginConfig(guildId, "adb-plugin-tempvoice");
const value = cfg?.someKey;

The dashboard writes to the same PluginConfig.data document. The _commands sub-key is reserved for per-command permissions — don't write to it directly.

4. Bump versions in both files

⚠️ npm publish reads the version from package.json, not plugin.json. Bump both or the publish 403s / metadata desyncs.

5. Commit, push, npm publish


Filed by the maintainer while rolling out the settings system across core plugins. moderation, levels, welcome, autorole, reaction-roles, and automod are already done — use them as reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions