Dashboard settings are simply a complex list of options that the user will be able to change in it. Our module allows the user to divide settings into categories, so this list should contain a category object. The category object itself also contains a list of settings for the category.

new DBD.Dashboard({
  settings: [categoryObject, categoryObject],
});

See more about categories and options

Example Usage

new DBD.Dashboard({
  settings: [
    {
        categoryId: 'input',
        categoryName: 'New Category',
        categoryImageURL: 'URL To image',
        categoryDescription: "Setup your bot with default settings!"
        toggleable: true,
        getActualSet: async ({ guild }) => {
          return settings['toggleeco'];
        },
        setNew: async ({ guild, newData }) => {
          settings['toggleeco'] = newData;
        },
        categoryOptionsList: [
            {
                optionId: 'prefix',
                optionName: "Prefix",
                optionDescription: "Set bot prefix.",
                optionType: DBD.formTypes.input('Prefix', 1, 4, false, false),
                getActualSet: async ({guild}) => {
                    // You will need to create your own query logic here. We use a variable as example!
                    return prefixData[guild.id] || '!';
                },
                setNew: async ({guild,newData}) => {
                    // You will need to create your own save logic here. We use a variable as example!
                    prefixData[guild.id] = newData || '!';
                    return;
                }
            },
        ]
    },
  ],
});

Props

settings
Object[]
required
categoryId
string
required

Unique ID of the category

categoryName
string
required

The Name that should be displayed

categoryImageURL
string

URL to an image to be shown

toggleable
boolean

If the category should be toggleable

categoryDescription
string
required

Short description of the category to be shown on the page

categoryOptionsList
Object[]
required

The options that should be included

optionId
string
required

Unique ID of the option

optionName
string
required

The Name that should be displayed

optionDescription
string
required

Short description of the option to be shown on the page

optionType
object
required

The formtype you want to use