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
ticketSysticketSys❌nonePass a ticketSys Object to customize things
btnRolebtnRole❌nonePass a btnRole Object to customize things

ticketSys options

ticketSys​

ParameterTypeRequiredDefaultDescription
ticketnamestring❌ticket-{userid}The name of the ticket when opened.
buttonsticketBtn❌DefaultPass a ticketBtn Object to customize the buttons
pingRolestring/string[]❌noneThe Array (or) String of Role(s) to ping when someone opens a ticket
categorystring❌noneThe parent category id of the category you want the tickets to be created
timedboolean❌noneAn Boolean option to delete tickets when the time is up.
embedCustomizableEmbed❌Default 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.