Skip to main content

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

const simplydjs = require("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
);

Options manageBtnOptions

ParameterTypeRequiredDefaultDescription
ticketSysticketSysnonePass a ticketSys Object to customize things
btnRolebtnRolenonePass a btnRole Object to customize things

ticketSys options

ticketSys

ParameterTypeRequiredDefaultDescription
ticketnamestringticket-{userid}The name of the ticket when opened.
buttonsticketBtnDefaultPass a ticketBtn Object to customize the buttons
pingRolestring/string[]noneThe Array (or) String of Role(s) to ping when someone opens a ticket
categorystringnoneThe parent category id of the category you want the tickets to be created
timedbooleannoneAn Boolean option to delete tickets when the time is up.
embedCustomizableEmbedDefault EmbedPass a CustomizableEmbed Object to customize the embed

ticketBtn

ParameterTypeDescription
closebtnTemplatePass an btnTemplate Object to customize the close button
reopenbtnTemplatePass an btnTemplate Object to customize the reopen button
deletebtnTemplatePass an btnTemplate Object to customize the delete button
transcriptbtnTemplatePass an btnTemplate Object to customize the transcript button
btnRole options

btnRole

ParameterTypeRequiredDefaultDescription
addedMsgstring✅ Added the {role} role to you.The message sent when the role is added.
removedMsgstring❌ Removed the {role} role from you.The message sent when the role is removed.