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
Types
simplydjs.manageSuggest(
button: ButtonInteraction,
options: manageSuggestOptions
): Promise<void>
- button:
ButtonInteraction
- options:
manageSuggestOptions
Options
manageSuggestOptions
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
strict | boolean | ❌ | false | Enables strict mode in manageSuggest |
embed | SuggestionEmbeds | ❌ | default embeds | Pass a SuggestionEmbeds Object to customize embeds |
export type manageSuggestOptions = {
embed?: SuggestionEmbeds;
strict?: boolean;
};
SuggestionEmbeds
Parameter | Type | Description |
---|---|---|
accept | CustomizableEmbed | A CustomizableEmbed Object to customize the accepted suggestion embed |
deny | CustomizableEmbed | A 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"
}
}
})