Skip to content

Adopt plugin settings + dashboard integration #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.

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": "defaultDuration",
      "type": "string",
      "label": "Default duration (e.g. 1h)"
    },
    {
      "key": "maxWinners",
      "type": "number",
      "label": "Max winners"
    }
  ]
}

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-giveaways");
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