Disabling or Enabling commands is a simple process, all that you need to do is move the command in or out of the 'disabled_cmds' folder and restart the bot.
Want to make your own command for the bot? The process is fairly simple for registering a new command.
We will run through creating a simple command for the bot. For this example, we're going to assume that we're making a new command called hello that will simply send a message to the channel it was used in saying "Hey!".
When creating a new command please edit
en.js in the
translations directory to include all your new phrases, if they overlap please use an existing one. You are not required to do this for every language, I am looking for better ways of streamlining the translations creation process, if you have any ideas please let me know.
Create a new file in the commands directory, we're going to call ours hello.js
Inside of your new file, paste the exports needed to for registering a command below and adjust them to your liking.
For our command we are creating; we are going to use the following exports.
We will now need to add the following to make sure our code knows what we're actually executing with this command.
Message - The commands triggering message Lang - The configuration language Tr - Translator function Args - Command arguments
After we have put all of this together, our hello.js file should now look something like this:
Restart the bot and check the console, if the command has been successfully registered, the following should appear in the console:
Now that we have a command that the bot recognises, all we have to do is add some functional code that should be executed when we run it, for this example, we want it to say "Hey!" in the chat we did the command in.
To do this, we simple need to put the following line:
Once this has been added, run the reload command with your bots own prefix, for this example, the prefix is
! so we will run
!reload hello. Now, when we do
!hello the bot should reply like this:
And that's it! You've created a fully operational command. From here-on out, it's up to you to decide what you want to create using discord.js.
If you want to use predefined embed colour values, you can just import tham with from the .env file.