{"_id":"@nodecord/core","_rev":"29-025549e0838f24055e1f3128cb3883c0","name":"@nodecord/core","dist-tags":{"latest":"0.2.1"},"versions":{"0.0.3-alfa.2":{"name":"@nodecord/core","version":"0.0.3-alfa.2","keywords":["discord","client","bot","discordapp","node","api","typescript","framework","tool"],"author":{"name":"Datzu712"},"license":"MIT","_id":"@nodecord/core@0.0.3-alfa.2","maintainers":[{"name":"juanes","email":"juan@meddyg.com"}],"contributors":[{"url":"https://github.com/Datzu712","name":"Datzu712"}],"homepage":"https://github.com/Datzu712/nodecord#readme","bugs":{"url":"https://github.com/Datzu712/nodecord/issues"},"dist":{"shasum":"1307a803cdfd791654d940b6ac8365eb855a8148","tarball":"https://registry.npmjs.org/@nodecord/core/-/core-0.0.3-alfa.2.tgz","fileCount":108,"integrity":"sha512-7qlKyVSNfCOa0WuCOQF+gjVZNPhPUYSKLS/AeYhAL0dl50PMOQdPWtry/dJB4Ok/bG+G8hdw04HL2jpLZn4gSg==","signatures":[{"sig":"MEUCIE6CxBe2jsRW6ICNNqrBBjlxZ4t2psw/tQKCUVy1zCyrAiEAlhxmdaNIli/JIiETJeIr8Hm+O6ErIS2p9jxg55uFRQU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":66868},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"d0e70f10748c52960708978bce319a43353ce468","scripts":{"build":"tsc"},"_npmUser":{"name":"juanes","email":"juan@meddyg.com"},"deprecated":"This version does not work, use 0.0.3-alfa.3+ onwards","repository":{"url":"git+https://github.com/Datzu712/nodecord.git","type":"git"},"_npmVersion":"10.2.4","description":"A powerful Node.js framework for create efficient and scalable discord bots.","directories":{},"_nodeVersion":"20.11.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^20.11.16","ts-essentials":"^9.4.1","reflect-metadata":"^0.2.1"},"peerDependencies":{"@nodecord/djs-adapter":"0.0.3-alfa.1"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.3-alfa.2_1706920825113_0.17597447307767933","host":"s3://npm-registry-packages"}},"0.0.3-alfa.3":{"name":"@nodecord/core","version":"0.0.3-alfa.3","keywords":["discord","client","bot","discordapp","node","api","typescript","framework","tool"],"author":{"name":"Datzu712"},"license":"MIT","_id":"@nodecord/core@0.0.3-alfa.3","maintainers":[{"name":"juanes","email":"juan@meddyg.com"}],"contributors":[{"url":"https://github.com/Datzu712","name":"Datzu712"}],"homepage":"https://github.com/Datzu712/nodecord#readme","bugs":{"url":"https://github.com/Datzu712/nodecord/issues"},"dist":{"shasum":"1eb3c945788c818eb653f9f2b2226f19709be77d","tarball":"https://registry.npmjs.org/@nodecord/core/-/core-0.0.3-alfa.3.tgz","fileCount":108,"integrity":"sha512-XOjP+PSqbJ5lHSOYcxwQHG4v+7UnZVt8NH3XDQC/ZzntUL0u1rowuZlBEzmx6BEYQl9td226M4qT1u4mzr812Q==","signatures":[{"sig":"MEYCIQDV14QaXtMje9UX1HfAjDFRbesBptrAeTsSfXk95z4xcwIhAI7czjMK/qlV9NJ5XF5WiHAkUdpLNB3+mBnAy8ikEqjU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":66868},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"d0e70f10748c52960708978bce319a43353ce468","scripts":{"build":"tsc"},"_npmUser":{"name":"juanes","email":"juan@meddyg.com"},"repository":{"url":"git+https://github.com/Datzu712/nodecord.git","type":"git"},"_npmVersion":"10.2.4","description":"A powerful Node.js framework for create efficient and scalable discord bots.","directories":{},"_nodeVersion":"20.11.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^20.11.16","ts-essentials":"^9.4.1","reflect-metadata":"^0.2.1"},"peerDependencies":{"@nodecord/djs-adapter":"0.0.3-alfa.3"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.3-alfa.3_1706920989048_0.48694075180426766","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@nodecord/core","version":"0.2.0","keywords":["discord","discord-bot","framework","typescript","dependency-injection","di","decorators","modular","inversify","slash-commands","interceptors","nestjs"],"author":"Datzu712","license":"MIT","_id":"@nodecord/core@0.2.0","maintainers":[{"name":"juanes","email":"juan@meddyg.com"}],"contributors":[{"url":"https://github.com/Datzu712","name":"Datzu712","author":true}],"homepage":"https://github.com/Datzu712/nodecord#readme","bugs":{"url":"https://github.com/Datzu712/nodecord/issues"},"dist":{"shasum":"619f62162bf2edb8a64e19913f520983bded37db","tarball":"https://registry.npmjs.org/@nodecord/core/-/core-0.2.0.tgz","fileCount":9,"integrity":"sha512-nnml/Og5YNjty4iaZoC12HwrnDU+Zg4jiz2Oe2qkRoJHVH3SHxnhqMRFapy+moAbIhzfvRdJ9N9dm0IZ69Ea+w==","signatures":[{"sig":"MEYCIQDKyixrHpBfa6JCyZ9t3WEc1GriV5hzQHGbzSKmjvZj3gIhALoMLbVEVetSezfU01/ma2LpYKs82frOtvC4PxlTLyM+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":405465},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","lint":"eslint . --ext .ts,.tsx","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"juanes","email":"juan@meddyg.com"},"repository":{"url":"git+https://github.com/Datzu712/nodecord.git","type":"git"},"directories":{},"_nodeVersion":"26.0.0","dependencies":{"inversify":"^8.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.5.1","typescript":"6.0.3","discord-api-types":"^0.38.48"},"_npmOperationalInternal":{"tmp":"tmp/core_0.2.0_1785177157491_0.10062211089036488","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@nodecord/core","version":"0.2.1","type":"module","types":"./dist/index.d.ts","main":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"repository":{"type":"git","url":"git+https://github.com/Datzu712/nodecord.git"},"author":"Datzu712","license":"MIT","bugs":{"url":"https://github.com/Datzu712/nodecord/issues"},"homepage":"https://github.com/Datzu712/nodecord#readme","publishConfig":{"access":"public"},"contributors":[{"name":"Datzu712","url":"https://github.com/Datzu712","author":true}],"keywords":["discord","discord-bot","framework","typescript","dependency-injection","di","decorators","modular","inversify","slash-commands","interceptors","nestjs"],"devDependencies":{"discord-api-types":"^0.38.48","typescript":"6.0.3"},"dependencies":{"inversify":"^8.1.0"},"scripts":{"dev":"tsdown --watch","build":"tsdown","lint":"oxlint --type-aware","typecheck":"tsc --noEmit"},"_nodeVersion":"26.0.0","_id":"@nodecord/core@0.2.1","dist":{"integrity":"sha512-BrBRKQ7+kH6kaafkKcdjAmElgi+Fmhb5s6H9JOgkwZtHJ9Pj5ankG0eXHuITZeaopZagnrbL2jkE5g3b/5Kl5g==","shasum":"53f9a7905c2d4c4dcb881f48c0863b073979a282","tarball":"https://registry.npmjs.org/@nodecord/core/-/core-0.2.1.tgz","fileCount":11,"unpackedSize":466892,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDgfTyL0aUVEdjmkpRukOjgzdF5U6azcnbaSYkZ/Bn6LwIgFmdD67Dnx2Q+d7MZUJki6YkNJDlRgtMnchZE1ORvJUQ="}]},"_npmUser":{"name":"juanes","email":"juan@meddyg.com"},"directories":{},"maintainers":[{"name":"juanes","email":"juan@meddyg.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_0.2.1_1785187561414_0.3690884600392912"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-03T00:40:25.002Z","modified":"2026-07-27T21:26:01.716Z","1.0.0":"2022-07-28T00:38:45.661Z","1.0.1":"2022-07-29T23:23:47.713Z","1.2.0-beta.1":"2022-07-29T23:32:08.867Z","1.0.0-alfa.1":"2022-07-29T23:43:04.244Z","1.0.3":"2022-07-29T23:45:46.000Z","1.2.0-alfa.1":"2022-07-31T03:31:28.484Z","0.0.1-alfa.1":"2023-06-25T14:58:37.495Z","0.0.1-alfa.2":"2023-06-25T15:05:40.611Z","0.0.1-alfa.3":"2023-06-25T15:08:14.570Z","0.0.1-alfa.5":"2023-06-25T15:23:44.563Z","0.0.1-alfa.6":"2023-06-26T17:38:46.337Z","0.0.1-alfa.7":"2023-11-15T23:14:26.670Z","0.0.1-alfa.8":"2023-11-15T23:42:21.482Z","0.0.1-alfa.9":"2023-11-15T23:46:09.639Z","0.0.2-alfa.1":"2024-02-03T00:29:59.511Z","0.0.3-alfa.1":"2024-02-03T00:36:25.366Z","0.0.3-alfa.2":"2024-02-03T00:40:25.370Z","0.0.3-alfa.3":"2024-02-03T00:43:09.208Z","0.2.0":"2026-07-27T18:32:37.651Z","0.2.1":"2026-07-27T21:26:01.567Z"},"bugs":{"url":"https://github.com/Datzu712/nodecord/issues"},"author":"Datzu712","license":"MIT","homepage":"https://github.com/Datzu712/nodecord#readme","keywords":["discord","discord-bot","framework","typescript","dependency-injection","di","decorators","modular","inversify","slash-commands","interceptors","nestjs"],"repository":{"type":"git","url":"git+https://github.com/Datzu712/nodecord.git"},"contributors":[{"name":"Datzu712","url":"https://github.com/Datzu712","author":true}],"maintainers":[{"name":"juanes","email":"juan@meddyg.com"}],"readme":"# @nodecord/core\n\n[![npm](https://img.shields.io/npm/v/@nodecord/core)](https://www.npmjs.com/package/@nodecord/core)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Docs](https://img.shields.io/badge/docs-nodecord.pages.dev-blue)](https://nodecord.pages.dev/)\n\nThe framework core of [Nodecord](https://github.com/Datzu712/nodecord), a TypeScript framework for building Discord bots around modules, dependency injection, and decorators.\n\nThis package holds the parts that do not depend on any Discord library: module compilation, the container hierarchy, the decorators, the command execution pipeline, interceptors, and exception handlers. To actually talk to Discord you also need an adapter, normally [`@nodecord/djs-adapter`](https://www.npmjs.com/package/@nodecord/djs-adapter).\n\n## Install\n\n```bash\npnpm add @nodecord/core @nodecord/djs-adapter discord.js\n```\n\nNodecord uses TypeScript's legacy decorators and reads constructor types from decorator metadata, so both options have to be enabled:\n\n```jsonc\n{\n    \"compilerOptions\": {\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n    },\n}\n```\n\nYou do not need to install or import `reflect-metadata` yourself. It arrives as a transitive dependency of Inversify and the polyfill is installed when this package is first imported.\n\nRequires Node.js 20 or newer.\n\n## Quick start\n\nA module declares what it provides, which commands it owns, and which other modules it needs.\n\n```typescript\nimport { Module } from '@nodecord/core';\n\n@Module({\n    imports: [LoggerModule],\n    providers: [PingService],\n    handlers: [PingCommand],\n})\nexport class BotModule {}\n```\n\nA command is a class decorated with `@SlashCommand`. Services arrive through the constructor, Discord data through parameter decorators on `execute()`.\n\n```typescript\nimport { Author, CommandHandler, SlashCommand } from '@nodecord/core';\nimport { SlashCommandBuilder, User } from 'discord.js';\n\n@SlashCommand(new SlashCommandBuilder().setName('ping').setDescription('Replies with pong'))\nexport class PingCommand implements CommandHandler {\n    constructor(private readonly pingService: PingService) {}\n\n    execute(@Author() author: User): string {\n        return `Pong! Hello, ${author.username}!`;\n    }\n}\n```\n\nBootstrapping compiles the module tree, wires the containers, and initializes the adapter:\n\n```typescript\nimport { NodecordClient } from '@nodecord/core';\nimport { GatewayIntentBits, type ClientOptions } from 'discord.js';\n\nimport { BotModule } from './bot.module.js';\n\nconst client = NodecordClient.create<ClientOptions>({\n    module: BotModule,\n    options: {\n        intents: [GatewayIntentBits.Guilds],\n    },\n});\n\nawait client.loadSlashCommands({\n    token: process.env.BOT_TOKEN!,\n    clientId: process.env.CLIENT_ID!,\n});\n\nawait client.login(process.env.BOT_TOKEN!);\n```\n\n`adapter` is optional. Pass an adapter instance, an adapter class, or leave it out and `DiscordJsAdapter` is used.\n\nUse `client.get(SomeService)` to pull an instance out of the dependency graph.\n\n## What this package exports\n\n| Decorator                | Applies to  | Purpose                                                  |\n| ------------------------ | ----------- | -------------------------------------------------------- |\n| `@Module()`              | class       | Declares imports, providers, handlers, and listeners     |\n| `@Injectable()`          | class       | Marks a class as resolvable by the container             |\n| `@Inject()`              | constructor | Injects a specific token                                 |\n| `@SlashCommand()`        | class       | Registers a slash command handler                        |\n| `@Listener()`            | class       | Registers a Discord event listener                       |\n| `@Autocomplete('opt')`   | method      | Handles autocomplete for one option of the command       |\n| `@Interceptor()`         | class       | Wraps command execution                                  |\n| `@UseInterceptors()`     | class       | Attaches interceptors to a single handler                |\n| `@OnException()`         | class       | Registers an exception handler for given exception types |\n| `@UseExceptionHandler()` | class       | Attaches exception handlers to a single handler          |\n| `@DeferReply()`          | method      | Defers the reply before running the handler              |\n\nParameter decorators, valid on both `execute()` and `@Autocomplete()` methods:\n\n| Decorator               | Resolves to                                           |\n| ----------------------- | ----------------------------------------------------- |\n| `@Context()` / `@Ctx()` | The `InteractionContext` for the current interaction  |\n| `@Author()`             | The user who triggered the interaction                |\n| `@Guild()`              | The guild the interaction came from, or `null`        |\n| `@Option()`             | Every option, as `ChatInputOption[]`                  |\n| `@Option('a')`          | That single option, as `ChatInputOption \\| undefined` |\n| `@Option('a', 'b')`     | Those options, as `ChatInputOption[]`                 |\n| `@Focused()`            | The option currently being autocompleted              |\n\nAlso exported: `NodecordClient`, `TestingModule`, `ConsoleLogger`, the context classes (`InteractionContext`, `ChatInputCommandContext`, `AutocompleteContext`, `ContextMenuContext`), `AbstractClientAdapter` for writing your own adapter, and the framework exception types.\n\n## Documentation\n\nFull guides live at [nodecord.pages.dev](https://nodecord.pages.dev/). Questions go to the [Discord server](https://discord.com/invite/BSaERbS).\n\n## Status\n\nThe API is still moving. Modules, DI, slash commands, listeners, parameter decorators, autocomplete, interceptors, exception handlers, and the testing utilities work today. Buttons, modals, select menus, and context menu commands are not implemented yet.\n\n## License\n\nMIT\n","readmeFilename":""}