Skip to content

How to add custom commands? #375

Answered by Androz2091
Androz2091 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello 👋

Here is a step-by-step tutorial to learn how to create custom commands in the bot. In this tutorial, we will try to create a "say" command (for example *say hello will make the bot send hello).

Step 1: create the file

The first thing to do is to create a .js file in the category folder of your choice. For example, you can create a commands/General/say.js file.

Then, open it.

Step 2: add base content

Each command file has a "base" content, it allows you to define command settings like whether the command can be run in DM, if there are any aliases, etc. Copy the following code into the say.js file:

const Command = require("../../base/Command.js");

class BaseCommand extends Command {

Replies: 2 comments 1 reply

Comment options

Androz2091
Jan 8, 2021
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by Androz2091
Comment options

You must be logged in to vote
1 reply
@Androz2091
Comment options

Androz2091 Jan 9, 2021
Maintainer Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants