Configuring Seyfert
TypeScript Configuration
For Seyfert to work correctly, you need to update your tsconfig.json
file and add emitDecoratorMetadata
and experimentalDecorators
to enable the use of decorators:
Selecting the Bot Type
Seyfert supports two types of applications that interact with the Discord API: one based on the gateway (websocket) and another based on the HTTP interaction system.
Each type has a distinct purpose, and it is crucial to understand their differences to choose the one that best suits your needs. If you are unsure which bot type to choose, we recommend using the Gateway option.
- The Gateway client handles all events emitted by Discord, such as
messageCreate
,interactionCreate
,guildCreate
,ready
, among others. - The available events depend on the intents configured in the client.
Configuration
Once you have modified the tsconfig.json
to support decorators, there are a few more steps before you can run your application. Seyfert is set up to automatically load your commands, events, components, and language.
For this, you need to create a file called seyfert.config.mjs
in the root folder of your project and add the configuration according to the bot type you selected:
This is not all, you also need to create a main file called index.ts
inside the src
folder (specified as base in the configuration) and start using it.
In addition to the above, you need to configure the appropriate types based on the client you are using:
For more information on how to declare types and what you can do with them, visit extending declare module.
Once these steps are completed, your project structure should look like this: