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
.js
file for the command, optionally placing it inside a folder. -
Define the Command: Use
SlashCommandBuilder
(orContextMenuCommandBuilder
for 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
makeUserInstallable
to 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
.js
file ininteractionHandling/buttonHandling
for 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
.js
file ininteractionHandling/selectMenuHandling
for the handler. - Export the handler function in this format:
module.exports = { menu_id: handleMenuFunction };
.
-
Define the model using
ModalBuilder
indiscord.js
.Example in
interactionHandling/buttonHandling/sendButton.js
. -
Create a new
.js
file ininteractionHandling/modalHandling
for the handler. -
Export the handler function in this format:
module.exports = { model_id: handleModelFunction };
.
checks.js
: Contains asaneUserCheck
function to verify if the button press was intended for the user.getTable.js
: IncludesconvertJsonToTable
andobjectToTable
for converting JSON into tables.LargeResponseDm.js
: Manages large responses, offering atextDmSendButton
for sending full content as a file/link.messageSplit.js
: Handles large responses by sending multiple split messages.others.js
: Includes themakeUserInstallable
function.addInteractions.js
: ProvidesaddButton
,addStringMenu
, andclearComponents
functions.sendingTools.js
: OfferssendEmbed
,editEmbed
, andsendErrorDM
functions.
This guide provides a comprehensive overview of configuring and handling interactions with the bot, ensuring a seamless user experience.