All Projects → SocketSomeone → necord

SocketSomeone / necord

Licence: MIT license
🤖 A module for creating Discord bots using NestJS, based on Discord.js

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to necord

nestjs-telegraf
🤖 Powerful Nest module for easy and fast creation Telegram bots
Stars: ✭ 300 (+289.61%)
Mutual labels:  bot-framework, nest, nestjs
Discord-Bot-TypeScript-Template
Discord bot - A discord.js bot template written with TypeScript.
Stars: ✭ 86 (+11.69%)
Mutual labels:  discordjs, bot-framework, discord-bot
Firstsight
前后端分离,服务端渲染的个人博客,基于 Nodejs、 Vue、 Nuxt、Nestjs、PostgreSQL、Apollo
Stars: ✭ 19 (-75.32%)
Mutual labels:  nest, nestjs
muser
Muser: A powerful Discord music bot made in DJs v13 managed by PGamerX, Peiprjs, and Luckie.
Stars: ✭ 66 (-14.29%)
Mutual labels:  discordjs, discord-bot
Azuma
A package that actually syncs your ratelimits across all your clusters on Discord.JS
Stars: ✭ 19 (-75.32%)
Mutual labels:  discordjs, discord-bot
azure-storage
Azure Storage module for Nest framework (node.js) ☁️
Stars: ✭ 71 (-7.79%)
Mutual labels:  nest, nestjs
LenoxBot
🖥️ LenoxBot is a Discord bot that offers many cool new features to your Discord server!
Stars: ✭ 218 (+183.12%)
Mutual labels:  discordjs, discord-bot
Discord-BOT-Dashboard
This version is outdated, please check out Discord BOT Dashboard v2
Stars: ✭ 32 (-58.44%)
Mutual labels:  discordjs, discord-bot
voice
Implementation of the Discord Voice API for discord.js and other JS/TS libraries
Stars: ✭ 310 (+302.6%)
Mutual labels:  discordjs, discord-bot
nest-rest-mongo-boilerplate
🍱 backend with nest (typescript), mongoose, and authentication
Stars: ✭ 180 (+133.77%)
Mutual labels:  nest, nestjs
suggestions-bot
A Discord bot designed to build better communities by encouraging a positive and constructive relationship between community and staff.
Stars: ✭ 22 (-71.43%)
Mutual labels:  discordjs, discord-bot
event-emitter
Event Emitter module for Nest framework (node.js) 🦋
Stars: ✭ 102 (+32.47%)
Mutual labels:  nest, nestjs
discord.js-modules
Modularisation of discord.js (WIP)
Stars: ✭ 210 (+172.73%)
Mutual labels:  discordjs, discord-bot
NanoSpace
Erela.js & Discord.js@v14 (Prefix Commands!)
Stars: ✭ 59 (-23.38%)
Mutual labels:  discordjs, discord-bot
hellsnakebot
🤖About A fully customizable bot built with discord.js
Stars: ✭ 14 (-81.82%)
Mutual labels:  discordjs, discord-bot
nestjs-otel
OpenTelemetry (Tracing + Metrics) module for Nest framework (node.js) 🔭
Stars: ✭ 273 (+254.55%)
Mutual labels:  nest, nestjs
Discord-EmojiToRole
A discord.js bot that assigns roles based on reactions to a message.
Stars: ✭ 55 (-28.57%)
Mutual labels:  discordjs, discord-bot
aws-nestjs-starter
Serverless, AWS, NestJS, GraphQL and DynamoDB starter
Stars: ✭ 200 (+159.74%)
Mutual labels:  nest, nestjs
discord-voice
⏲️ A complete framework to facilitate the tracking of user voice time using discord.js
Stars: ✭ 33 (-57.14%)
Mutual labels:  discordjs, discord-bot
partner-bot
Automates partnerships in the big community of discord.
Stars: ✭ 119 (+54.55%)
Mutual labels:  discordjs, discord-bot

Necord Logo

🤖 A module for creating Discord bots using NestJS, based on Discord.js

Documentation Source code 🪡Examples 🛠️Community 💬

About

This package uses the best of the NodeJS world under the hood. Discord.js is the most powerful library for creating bots and Nest.js is a progressive framework for creating well-architectured applications. This module provides fast and easy way for creating Discord bots and deep integration with your NestJS application.

Features

  • Simple. Flexible. Easy to use.
  • Ability to create custom decorators.
  • Interact with Discord (Slash Commands, Context Menus, Message Components, Listeners).
  • Full support of NestJS guards, interceptors, filters and pipes!

For questions and support please use the Issues.

Installation

Node.js 16.6.0 or newer is required.

$ npm i necord discord.js
$ yarn add necord discord.js
$ pnpm add necord discord.js

Usage

Once the installation process is complete, we can import the NecordModule into the root AppModule:

import { NecordModule } from 'necord';
import { Module } from '@nestjs/common';
import { Intents } from 'discord.js';

@Module({
    imports: [
        NecordModule.forRoot({
            token: 'DISCORD_BOT_TOKEN',
            intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES]
        })
    ],
    providers: []
})
export class AppModule {
}

Then create app.update.ts file and add On/Once decorators for handling Discord API events:

import { Injectable, Logger } from '@nestjs/common';
import { Context, On, Once, ContextOf } from 'necord';
import { Client } from 'discord.js';

@Injectable()
export class AppUpdate {
    private readonly logger = new Logger(AppUpdate.name);

    public constructor(private readonly client: Client) {
    }
    
    @Once('ready')
    public onReady(@Context() [client]: ContextOf<'ready'>) {
        this.logger.log(`Bot logged in as ${client.user.username}`);
    }

    @On('warn')
    public onWarn(@Context() [message]: ContextOf<'warn'>) {
        this.logger.warn(message);
    }
}

Whenever you need to handle any event data, use the Context decorator.

If you want to fully dive into Necord check out these resources:

  • Necord Wiki - Official documentation of Necord.
  • Nest JS - A progressive framework for creating well-architectured applications.
  • Discord JS - The most powerful library for creating bots.
  • Discord API - Official documentation of Discord API.

Stay in touch

License

MIT © Alexey Filippov

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].