{"id":14978641,"url":"https://github.com/necordjs/necord","last_synced_at":"2025-05-15T00:14:18.459Z","repository":{"id":36961686,"uuid":"410028154","full_name":"necordjs/necord","owner":"necordjs","description":"🤖 A module for creating Discord bots using NestJS, based on Discord.js","archived":false,"fork":false,"pushed_at":"2025-05-13T11:24:35.000Z","size":6166,"stargazers_count":412,"open_issues_count":1,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-13T12:31:14.713Z","etag":null,"topics":["bot","bot-framework","discord","discord-bot","discord-bot-api","discordjs","javascript","nest","nestjs","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://necord.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/necordjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["SocketSomeone","necordjs"],"open_collective":"necord"}},"created_at":"2021-09-24T16:16:12.000Z","updated_at":"2025-05-13T11:24:37.000Z","dependencies_parsed_at":"2023-09-22T23:45:55.047Z","dependency_job_id":"278b22f2-176f-4f6b-af04-ab1e5644f52e","html_url":"https://github.com/necordjs/necord","commit_stats":{"total_commits":1549,"total_committers":10,"mean_commits":154.9,"dds":0.3789541639767592,"last_synced_commit":"d6f114a304438a607bf1e5298463a98d7ffbd7d8"},"previous_names":[],"tags_count":96,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/necordjs%2Fnecord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/necordjs%2Fnecord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/necordjs%2Fnecord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/necordjs%2Fnecord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/necordjs","download_url":"https://codeload.github.com/necordjs/necord/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142110,"owners_count":22021461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","bot-framework","discord","discord-bot","discord-bot-api","discordjs","javascript","nest","nestjs","nodejs","typescript"],"created_at":"2024-09-24T13:58:05.799Z","updated_at":"2025-05-15T00:14:18.361Z","avatar_url":"https://github.com/necordjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/SocketSomeone","https://github.com/sponsors/necordjs","https://opencollective.com/necord"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n   \u003ch1\u003e\n       \u003ca href=\"#\"\u003e\u003cimg src=\"https://necord.org/img/logo.png\" alt =\"Necord Logo\"\u003e\u003c/a\u003e\n   \u003c/h1\u003e\n   🤖 A module for creating \u003cb\u003e\u003ca href=\"https://discord.com/\"\u003eDiscord\u003c/a\u003e bots\u003c/b\u003e using \u003ca href=\"https://nestjs.com\"\u003eNestJS\u003c/a\u003e, based on \u003ca href=\"https://discord.js.org/\"\u003eDiscord.js\u003c/a\u003e\n   \u003cbr/\u003e\u003cbr/\u003e\n   \u003ca href=\"https://necord.org\"\u003eDocumentation ✨\u003c/a\u003e \u0026emsp; \u003ca href=\"https://github.com/necordjs/necord\"\u003eSource code 🪡\u003c/a\u003e \u0026emsp; \u003ca href=\"https://github.com/necordjs/samples\"\u003eExamples 🛠️\u003c/a\u003e \u0026emsp; \u003ca href=\"https://discord.gg/mcBYvMTnwP\"\u003eCommunity 💬\u003c/a\u003e\n\u003c/div\u003e\n\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href='https://img.shields.io/npm/v/necord'\u003e\u003cimg src=\"https://img.shields.io/npm/v/necord\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n    \u003ca href='https://img.shields.io/npm/l/necord'\u003e\u003cimg src=\"https://img.shields.io/npm/l/necord\" alt=\"NPM License\" /\u003e\u003c/a\u003e\n    \u003ca href='https://img.shields.io/npm/dm/necord'\u003e\u003cimg src=\"https://img.shields.io/npm/dm/necord\" alt=\"NPM Downloads\" /\u003e\u003c/a\u003e\n    \u003ca href='https://img.shields.io/github/last-commit/necordjs/necord'\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/SocketSomeone/necord\" alt=\"Last commit\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n## About\n\nThis package uses the best of the Node.js world under the hood. \n[Discord.js](https://github.com/discordjs/discord.js) is the most powerful\nlibrary for creating bots and [Nest.js](https://github.com/nestjs) is a progressive framework for creating well-architectured applications.\nThis module provides a fast and easy way of creating Discord bots and deep integration with your NestJS application.\n\n**Features**\n\n- Simple. Flexible. Easy to use.\n- Ability to create custom decorators.\n- Interact with Discord (Slash Commands, Context Menus, Message Components, Listeners).\n- Full support of NestJS guards, interceptors, filters and pipes!\n\nFor questions and support, please use\nthe [Issues](https://github.com/necordjs/necord/issues/new?assignees=\u0026labels=question\u0026template=question.yml).\n\n## Installation\n\n**Node.js 18.0.0 or newer is required.**\n\n```bash\n$ npm i necord discord.js\n$ yarn add necord discord.js\n$ pnpm add necord discord.js\n```\n\n## Usage\n\nOnce the installation process is complete, we can import the `NecordModule` into the root `AppModule`:\n\n```typescript\nimport { NecordModule } from 'necord';\nimport { Module } from '@nestjs/common';\nimport { AppUpdate } from './app.update';\n\n@Module({\n    imports: [\n        NecordModule.forRoot({\n            token: 'DISCORD_BOT_TOKEN',\n            intents: ['Guilds', 'GuildMessages', 'DirectMessages']\n        })\n    ],\n    providers: [AppUpdate]\n})\nexport class AppModule {\n}\n```\n\nThen create `app.update.ts` file and add `On`/`Once` decorators for handling Discord API events:\n\n```typescript\nimport { Injectable, Logger } from '@nestjs/common';\nimport { Context, On, Once, ContextOf } from 'necord';\nimport { Client } from 'discord.js';\n\n@Injectable()\nexport class AppUpdate {\n    private readonly logger = new Logger(AppUpdate.name);\n\n    public constructor(private readonly client: Client) {\n    }\n    \n    @Once('ready')\n    public onReady(@Context() [client]: ContextOf\u003c'ready'\u003e) {\n        this.logger.log(`Bot logged in as ${client.user.username}`);\n    }\n\n    @On('warn')\n    public onWarn(@Context() [message]: ContextOf\u003c'warn'\u003e) {\n        this.logger.warn(message);\n    }\n}\n```\n\nWhenever you need to handle any event data, use the `Context` decorator.\n\nIf you want to fully dive into Necord, check out these resources:\n\n* [Necord Wiki](https://necord.org) - Official documentation of Necord.\n* [Nest JS](https://docs.nestjs.com) - A progressive framework for creating well-architectured applications.\n* [Discord JS](https://discord.js.org) - The most powerful library for creating bots.\n* [Discord API](https://discord.com/developers/docs) - Official documentation of Discord API.\n\n## Backers\n\n\u003ca href=\"https://opencollective.com/necord\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/necord/backers.svg?width=1000\"/\u003e\u003c/a\u003e\n\n## Stay in touch\n\n* Author - [Alexey Filippov](https://t.me/socketsomeone)\n* Twitter - [@SocketSomeone](https://twitter.com/SocketSomeone)\n\n## License\n\n[MIT](https://github.com/necordjs/necord/blob/master/LICENSE) © [Alexey Filippov](https://github.com/SocketSomeone)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnecordjs%2Fnecord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnecordjs%2Fnecord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnecordjs%2Fnecord/lists"}