Skip to main content

๐Ÿ”Ž Have a see inside

There is a lot of files inside sources/modules/templates but let's see what it all adds up to.

The only mandatory file for your module to be considered valid is data.json all the others are completely optional, if you don't need them you can delete them. This is where you define the name of the module, the emoji and the description, as shown below :

{
"title":
"Template",
"emoji":
"๐Ÿ‘ค",
"description":
"A module that serves as an example!"
}

buttons โ†’ for your buttons

channels โ†’ 3 types of files are possible :

  • those ending with create.js will be automatically launched when a channel is created
  • those ending with delete.js will be automatically launched when a channel is deleted
  • those ending with update.js will be automatically launched when a channel is updated

commands โ†’ for your commands

members โ†’ 3 types of files are possible :

  • those ending with join.js will be automatically launched when a member joins a guild
  • those ending with leave.js will be automatically launched when a member leaves a guild
  • those ending with update.js will be automatically launched when a member is updated on a guild

menus โ†’ for your select menus

messages โ†’ 3 types of files are possible :

  • those ending with create.js will be automatically launched when a message is created
  • those ending with delete.js will be automatically launched when a message is deleted
  • those ending with update.js will be automatically launched when a message is updated

modals โ†’ for your modals (forms)

models โ†’ models are a quick and easy way of creating objects linked to your database; please read the example of the /models command to understand this

presences โ†’ to check presences updates (status & activities of users and bots)

reactions โ†’ 2 types of files are possible :

  • those ending with add.js will be automatically launched when a reaction is added to a message
  • those ending with remove.js will be automatically launched when a reaction is removed from a message

tasks โ†’ define recurring tasks such as an automatic message or checking for updates

data.json โ†’ name, emoji and description for the module

init.js โ†’ any functions to be started when the bot is launched to initialise the module

utils โ†’ You will notice that there is a utils folder, which is not automatically imported by the system, it is a totally optional folder which can have any other name (it doesn't matter) in which you save functions, classes or anything else that can be used in your module

Each folder can contain as many files as necessary, please take care for folders that manage several events (for example: create, update and delete events) to add the extension corresponding to the event in question (channel_create.js, channel_update.js, channel_delete.js)

In the next few sections, you'll find out how this system will simplify your life when it comes to creating features and managing databases.