A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
๐จ๐ปโ๐ป Installation
$ npm install @discord-nestjs/core discord.js
Or via yarn
$ yarn add @discord-nestjs/core discord.js
๐งพ Description
NestJS package for discord.js
This monorepo consists of several packages.
- @discord-nestjs/core - Main package containing decorators, basic types and module declaration.
- @discord-nestjs/common - Contains optional common templates. For example SlashCommandPipe or ValidationPipe.
- @discord-nestjs/schematics - Provides cli to create a bot template.
- Samples
- @sample/command - Bot example with slash commands
- @sample/command-by-glob - Bot example with slash commands by glob pattern
- @sample/command-by-http-request - Bot example with register slash commands by http request
- @sample/sub-command - Bot example with slash sub-commands and sub-groups
- @sample/validation - Bot example with slash commands validation
- @sample/event - Bot example with events
- @sample/dependency-injection - Bot example with dependency injection
- @sample/reaction-collector - Bot example with reaction collector
- @sample/message-collector - Bot example with message collector
- @sample/interaction-collector - Bot example with interaction collector
- @sample/prefix-command - Bot example with prefix command
- @sample/modals - Bot example with modals
โ Answers on questions
The bot starts up, but the slash commands and events do not work
Click to expand
Check your intent is passed to the discordClientOptions
of the module. More info
SlashCommandPipe
, but when I receive response to the command, the DTO fields are missing
I created DTO and added Click to expand
Set useDefineForClassFields
to true
in your tsconfig.json
.
Also check that the @InteractionEvent
decorators are set.
Any questions or suggestions? Join Discord https://discord.gg/kv89Q2dXSR