manageBtn
A Button Handler for simplydjs package functions.
WARNING
clickBtn()
is deprecated !
Use manageBtn()
instead of clickBtn()
note
This function requires you to connect() to the mongo database !
Program
- Javascript
- Typescript
const simplydjs = require("simply-djs");
import simplydjs from "simply-djs";
simplydjs.manageBtn(interaction, {
// options (optional)
})
note
This function requires you to connect() to the mongo database !
Arguments:
simplydjs.manageBtn(
interaction: Discord.ButtonInteraction,
options: manageBtnOptions
);
- interaction:
Discord.ButtonInteraction
- options:
manageBtnOptions
Options manageBtnOptions
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
ticketSys | ticketSys | ❌ | none | Pass a ticketSys Object to customize things |
btnRole | btnRole | ❌ | none | Pass a btnRole Object to customize things |
ticketSys options
ticketSys
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
ticketname | string | ❌ | ticket-{userid} | The name of the ticket when opened. |
buttons | ticketBtn | ❌ | Default | Pass a ticketBtn Object to customize the buttons |
pingRole | string/string[] | ❌ | none | The Array (or) String of Role(s) to ping when someone opens a ticket |
category | string | ❌ | none | The parent category id of the category you want the tickets to be created |
timed | boolean | ❌ | none | An Boolean option to delete tickets when the time is up. |
embed | CustomizableEmbed | ❌ | Default Embed | Pass a CustomizableEmbed Object to customize the embed |
ticketBtn
Parameter | Type | Description |
---|---|---|
close | btnTemplate | Pass an btnTemplate Object to customize the close button |
reopen | btnTemplate | Pass an btnTemplate Object to customize the reopen button |
delete | btnTemplate | Pass an btnTemplate Object to customize the delete button |
transcript | btnTemplate | Pass an btnTemplate Object to customize the transcript button |