config.js: This file is used to configure the basic settings for the bot.
To handle embedded messages, use the sendEmbed or editEmbed functions from tools/sendingTools.
let msg = await sendEmbed(message, { title: 'Your Message', description: `You mentioned me! Here’s your message: "${message.content}"` });Located in message.js.
msg = editEmbed(interaction.message, { title: titleInput, description: textInput }, interaction);Located in interactionHandling/modalHandling/inputModal.js.
- Mentions are handled by default in
message.js.
-
Navigate to Interaction Handling: Start by navigating to the interaction handling section.
-
Create a New Command: Create a new
.jsfile for the command, optionally placing it inside a folder. -
Define the Command: Use
SlashCommandBuilder(orContextMenuCommandBuilderfor context menu commands) in discord.js and include the handler function. -
Export the Command: Use
module.exports = { ... }to export the handler function and the command itself.module.exports = { handleCommand1, com1 };
Located in
command1.js.
-
Use
makeUserInstallableto enable the command as a user-installable app.module.exports = { handleMsgInfoCom, comMsgInfo: makeUserInstallable(comMsgInfo) };
Located in
ContextMenuCommands/msgInfo.js.
Use the addButton function from tools/addInteractions.js.
msg = await addButton(msg, { id: 'delete_message', label: 'Delete', emoji: '🗑️' });Located in message.js.
- Create a new
.jsfile ininteractionHandling/buttonHandlingfor the button handler. - Export the handler function in this format:
module.exports = { button_id: handleButtonFunction };.
Use the addStringMenu function from tools/addInteractions.js.
msg = await addStringMenu(msg, menu, interaction);Located in interactionHandling/buttonHandling/test/listButton.js.
- Create a new
.jsfile ininteractionHandling/selectMenuHandlingfor the handler. - Export the handler function in this format:
module.exports = { menu_id: handleMenuFunction };.
-
Define the model using
ModalBuilderindiscord.js.Example in
interactionHandling/buttonHandling/sendButton.js. -
Create a new
.jsfile ininteractionHandling/modalHandlingfor the handler. -
Export the handler function in this format:
module.exports = { model_id: handleModelFunction };.
checks.js: Contains asaneUserCheckfunction to verify if the button press was intended for the user.getTable.js: IncludesconvertJsonToTableandobjectToTablefor converting JSON into tables.LargeResponseDm.js: Manages large responses, offering atextDmSendButtonfor sending full content as a file/link.messageSplit.js: Handles large responses by sending multiple split messages.others.js: Includes themakeUserInstallablefunction.addInteractions.js: ProvidesaddButton,addStringMenu, andclearComponentsfunctions.sendingTools.js: OfferssendEmbed,editEmbed, andsendErrorDMfunctions.
This guide provides a comprehensive overview of configuring and handling interactions with the bot, ensuring a seamless user experience.