Setup Project
Prerequisites
In order to use Seyfert, you must have installed:
- NodeJS installed (18 or higher)
- TypeScript installed (4.9 or higher)
- npm installed (or a package manager alike)
Install seyfert
Also you might want to install the github version for the latest changes:
Typescript settings
To make Seyfert work as intended you must update your tsconfig.json
file and add emitDecoratorMetadata
and experimentalDecorators
in order to be able to use decorators:
Selecting Your Bot Type.
Currently, Seyfert supports two types of applications: one based on the Discord gateway, and one based on the Discord HTTP interaction system, the former being used the most. It is key to understand the differences between these two types in order to choose whichever application for your needs.
- The Gateway client receives all events from discord like messageCreate, interactionCreate, guildCreate, ready, etc.
- The events that the client receives depend on the client intents.
- Unlike gateway, does not receive events.
- Only executes commands with an http request from discord.
Configuration
Once tsconfig.json
has been modified, we still have a few steps to follow before we can run our bot. In this case, you must tell your project’s structure to seyfert:
so create a file called seyfert.config.js
in the root folder of your project and add the following code:
And let’s create the main file called index
in the src
folder and add the following code:
In order to use the http client, you must install uws-adapter
.
So after finishing these steps, your project structure should look like this:
Directorysrc
- index.ts
- seyfert.config.js
- package.json
- .env
- tsconfig.json