Skip to main content

⏬️ Include in an existing project

If you already have a project (without clappybot), you can easily add this framework.

0️⃣ Requirement​

Before you can really get started, you'll need to download the framework:

npm install clappybot@latest

You will also need to provide the environment file, for this look at 📝 Environment configuration

1️⃣ Index​

First, you need to include clappybot in your index file (the main file of your project) like this :

import { clappybot } from 'clappybot';

Now, let's initialise the framework.

clappybot.init(bot);

Here bot should be the instance of your discord client, in general it is called bot or client by convention but you could have called it something else, the important thing is that this variable corresponds to new Client(<YOUR_PARAMETERS_HERE>).

2️⃣ Modules​

Now you just have to create your modules inside sources/modules, learn how thank's to this page : 📦 Modules