Skip to main content

manageSuggest

A Suggestion handler which handles all sugestions from the package

This function requires connect() which connects to the mongo database !

caution

You should use suggest() before this function. Because handlers are like back-end (core), They just handle things. But suggest is like front-end. without this, handlers are useless.

Implementation

simplydjs.manageSuggest(interaction, { 
// options (optional)
})

Output

suggestion accepted

Types

simplydjs.manageSuggest(
button: ButtonInteraction,
options: manageSuggestOptions
): Promise<void>

Options

manageSuggestOptions

ParameterTypeRequiredDefaultDescription
strictbooleanfalseEnables strict mode in manageSuggest
embedSuggestionEmbedsdefault embedsPass a SuggestionEmbeds Object to customize embeds
export type manageSuggestOptions = {
embed?: SuggestionEmbeds;
strict?: boolean;
};

SuggestionEmbeds

ParameterTypeDescription
acceptCustomizableEmbedA CustomizableEmbed Object to customize the accepted suggestion embed
denyCustomizableEmbedA CustomizableEmbed Object to customize the denied suggestion embed
export interface SuggestionEmbeds {
accept?: CustomizableEmbed;
deny?: CustomizableEmbed;
}

Example

  • Default settings

interactionCreate.js
const simplydjs = require('simply-djs')

simplydjs.manageSuggest(interaction)
  • Customized with options

interactionCreate.js
const simplydjs = require('simply-djs')

simplydjs.manageSuggest(interaction, {
strict: true,
embed: {
accept: {
title: "Accepted the suggestion",
color: "DarkGreen"
},
deny: {
title: "Denied the suggestion",
color: "Red"
}
}
})