{"_id":"@dan_koyuki/discrafterjs","_rev":"3-e033032daf46626ca45b3f3073ca60a6","name":"@dan_koyuki/discrafterjs","dist-tags":{"latest":"0.3.1"},"versions":{"0.2.0":{"name":"@dan_koyuki/discrafterjs","version":"0.2.0","keywords":["discord","discord.js","framework","typescript"],"author":{"name":"Dan"},"license":"MIT","_id":"@dan_koyuki/discrafterjs@0.2.0","maintainers":[{"name":"dan_koyuki","email":"dankoyuki398@gmail.com"}],"dist":{"shasum":"e7cdd4eda5d469c383d00d6a59a7c2a444cfd284","tarball":"https://registry.npmjs.org/@dan_koyuki/discrafterjs/-/discrafterjs-0.2.0.tgz","fileCount":46,"integrity":"sha512-VbNsAROskmTXpoc4bOagPPKeaSmvofAmi/RhBzBQxWviu5wQl95ohZC8+15BHwe6At2MLjA4muqkzgmOpQbk8w==","signatures":[{"sig":"MEYCIQCtVW8WM/TGKMlK7gXdRFm56gjVqTyl6cb84RKXo2f4GgIhALHlbwM0G2jT3MyrOFx8s4dllMp0qkm2WWoMdyP1uDyV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":67665},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16.11.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"fc72cbea29ede1f61abda799617bb701495dc875","scripts":{"dev":"ts-node --esm src/index.ts","build":"tsc","start":"node dist/index.js","prepare":"npm run build"},"_npmUser":{"name":"dan_koyuki","email":"dankoyuki398@gmail.com"},"_npmVersion":"11.4.1","description":"A Discord.js framework built with TypeScript","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","discord.js":"^14.22.1","typescript":"^5.9.2","@types/node":"^24.3.1"},"peerDependencies":{"glob":"^11.0.3","discord.js":"^14.22.1"},"_npmOperationalInternal":{"tmp":"tmp/discrafterjs_0.2.0_1758269561978_0.8463374443732086","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@dan_koyuki/discrafterjs","version":"0.3.0","keywords":["discord","discord.js","framework","typescript"],"author":{"name":"Dan"},"license":"MIT","_id":"@dan_koyuki/discrafterjs@0.3.0","maintainers":[{"name":"dan_koyuki","email":"dankoyuki398@gmail.com"}],"homepage":"https://github.com/Danang-Bahtiar/DiscrafterJS?tab=readme-ov-file#discrafterjs","bugs":{"url":"https://github.com/Danang-Bahtiar/DiscrafterJS/issues"},"dist":{"shasum":"870955324621f51dd958d083c98cc741447bf92d","tarball":"https://registry.npmjs.org/@dan_koyuki/discrafterjs/-/discrafterjs-0.3.0.tgz","fileCount":54,"integrity":"sha512-nIqejS/ODIZKo4S+8YAfyg41vfU2ZpAT8Uz62pOg9tOlih/pZU6WQZ9r0XP2C2g8NkoJ5UWNp5tcSqNJAM/6qg==","signatures":[{"sig":"MEYCIQCmNAZVZjg8omXFOmI27UsgjwY6hFwCADGsmYWG1Uw6+gIhAKf0dBXet24v7jHDUOCktdfIVRq3HdtlTy+16G1lscCD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84074},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16.11.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"3317b74742377efc00909f105f533a10c27c9c0c","scripts":{"dev":"ts-node --esm src/index.ts","build":"tsc","start":"node dist/index.js","prepare":"npm run build"},"_npmUser":{"name":"dan_koyuki","email":"dankoyuki398@gmail.com"},"repository":{"url":"git+https://github.com/Danang-Bahtiar/DiscrafterJS.git","type":"git"},"_npmVersion":"11.4.1","description":"A Discord.js framework built with TypeScript","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","discord.js":"^14.22.1","typescript":"^5.9.2","@types/node":"^24.3.1"},"peerDependencies":{"glob":"^11.0.3","discord.js":"^14.22.1"},"_npmOperationalInternal":{"tmp":"tmp/discrafterjs_0.3.0_1758602015234_0.054431668769451935","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@dan_koyuki/discrafterjs","version":"0.3.1","description":"A Discord.js framework built with TypeScript","main":"dist/index.js","types":"dist/index.d.ts","type":"module","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"engines":{"node":">=16.11.0"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"ts-node --esm src/index.ts","prepare":"npm run build"},"keywords":["discord","discord.js","framework","typescript"],"author":{"name":"Dan"},"license":"MIT","peerDependencies":{"discord.js":"^14.22.1","glob":"^11.0.3"},"devDependencies":{"@types/node":"^24.3.1","discord.js":"^14.22.1","ts-node":"^10.9.2","typescript":"^5.9.2"},"repository":{"type":"git","url":"git+https://github.com/Danang-Bahtiar/DiscrafterJS.git"},"bugs":{"url":"https://github.com/Danang-Bahtiar/DiscrafterJS/issues"},"homepage":"https://github.com/Danang-Bahtiar/DiscrafterJS?tab=readme-ov-file#discrafterjs","_id":"@dan_koyuki/discrafterjs@0.3.1","gitHead":"6aa795b2d33a13fb3ca034a3f15f7c767034a296","_nodeVersion":"22.14.0","_npmVersion":"11.4.1","dist":{"integrity":"sha512-Ep8XKae6hsGVSfWqQRM2ipQStqTqfms2o8dLvJ1S00RDMCUnjsFHWRC8DC7W77kL6bbxsxA2EMcNQIfN7AvIyw==","shasum":"f804bdd878addcb06d40959ddf3d0b5193d5140f","tarball":"https://registry.npmjs.org/@dan_koyuki/discrafterjs/-/discrafterjs-0.3.1.tgz","fileCount":62,"unpackedSize":85637,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCqwefE0u0mOIa9w05zEBrwen4BJRiLYs48kP56FVcdGQIgRpIE8kuSp4CZMrd/vL7MNLzGJpM+Tyz3Zvx/N4yIK5o="}]},"_npmUser":{"name":"dan_koyuki","email":"dankoyuki398@gmail.com"},"directories":{},"maintainers":[{"name":"dan_koyuki","email":"dankoyuki398@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/discrafterjs_0.3.1_1758796418204_0.654702173115201"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-19T08:12:41.909Z","modified":"2025-09-25T10:33:38.565Z","0.2.0":"2025-09-19T08:12:42.180Z","0.3.0":"2025-09-23T04:33:35.437Z","0.3.1":"2025-09-25T10:33:38.388Z"},"bugs":{"url":"https://github.com/Danang-Bahtiar/DiscrafterJS/issues"},"author":{"name":"Dan"},"license":"MIT","homepage":"https://github.com/Danang-Bahtiar/DiscrafterJS?tab=readme-ov-file#discrafterjs","keywords":["discord","discord.js","framework","typescript"],"repository":{"type":"git","url":"git+https://github.com/Danang-Bahtiar/DiscrafterJS.git"},"description":"A Discord.js framework built with TypeScript","maintainers":[{"name":"dan_koyuki","email":"dankoyuki398@gmail.com"}],"readme":"# DiscrafterJS\r\n[![npm version](https://img.shields.io/npm/v/@dan_koyuki/discrafterjs.svg)](https://www.npmjs.com/package/@dan_koyuki/discrafterjs)\r\n[![GitHub stars](https://img.shields.io/github/stars/Danang-Bahtiar/DiscrafterJS.svg?style=social)](https://github.com/Danang-Bahtiar/DiscrafterJS)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\n\r\n## Overview\r\n\r\nDiscrafterJS is a framework built on top of Discord.js. This framework was created with the goal of making Discord bot development easier and more structured. Adapting an opinionated coding style and convention system, DiscrafterJS enforces consistency in how commands, events, and configurations are written. By doing so, it reduces ambiguity, improves readability, and helps developers focus more on functionality rather than boilerplate.\r\n\r\n## Features\r\n- 🔧 Opinionated structure for commands, events, and helpers\r\n- ⚡ CLI scaffolder via `npx create-discrafter-bot`\r\n- 📦 TypeScript support out of the box (but feels like JS)\r\n- 🔌 Easy to extend with your own handlers\r\n- 🛠️ Default helpers dispatcher (optional)\r\n\r\n\r\n## Installation\r\n\r\n- Direct from GitHub\r\n\r\n  ```js\r\n  npm i https://github.com/Danang-Bahtiar/DiscrafterJS.git\r\n  ```\r\n\r\n- From NPM Registry\r\n\r\n  ```js\r\n  npm i @dan_koyuki/discrafterjs\r\n  ```\r\n\r\n- Using Scaffolder\r\n\r\n  ```js\r\n  npx create-discrafter-bot\r\n  ```\r\n\r\n## Usage\r\n\r\n1. Create `discrafter.config.js` in the project root:\r\n\r\n   ```js\r\n   // example discrafter.config.js\r\n   import { defineConfig } from \"@dan_koyuki/discrafterjs\";\r\n   import { GatewayIntentBits } from \"discord.js\";\r\n   \r\n   const config = defineConfig({\r\n    core: {\r\n      intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],\r\n      clientId: \"your-client-id\",\r\n      discordToken: \"your-discord-token\",\r\n      ownerId: \"your-bot-owner-id-or-your-user-id\"\r\n    },\r\n    development: {\r\n      developmentMode: true,\r\n      developmentGuildId: \"your-guild-id\",\r\n    },\r\n    slashCommand: {\r\n       useDefaultHandler: true,\r\n       // the default handler of slashCommand will search and load file from customDirPath if given.\r\n       customDirPath: \"./src/slashCommands\",\r\n       globalRegister: false\r\n       guilds: [\"guild-id-1\", \"guild-id-2\"]},\r\n    event: {\r\n       useDefaultHandler: true,\r\n       // the default handler of event will search and load file from customDirPath if given.\r\n       customDirPath: \"./src/events\"\r\n    },\r\n    helper: {\r\n       useDefaultHandler: true,\r\n       // the default handler of helperFunction will search and load file from customDirPath if given.\r\n       customDirPath: \"./src/helpers\"\r\n    },\r\n    custom: {\r\n       useDefaultInteractionEvent: true,\r\n    },\r\n   });\r\n\r\n   export default config;\r\n   ```\r\n\r\n2. `index.js`\r\n\r\n   ```js\r\n   import { Discrafter } from \"@dan_koyuki/discrafterjs\";\r\n\r\n   const bot = Discrafter.create();\r\n   bot.login();\r\n\r\n   export default bot;\r\n   ```\r\n\r\n3. Creating SlashCommand files\r\n\r\n   ```js\r\n   // src/command/ping.js\r\n   import { Discrafter } from \"@dan_koyuki/discrafterjs\";\r\n   import { SlashCommandBuilder } from \"discord.js\";\r\n   import {bot} from \"./index.js\"\r\n\r\n   export default Discrafter.SlashCommand({\r\n     data: new SlashCommandBuilder().setName(\"register\").setDescription(\"Register a player!!\"),\r\n     execute: async (client, interaction) => {\r\n       //your logic here\r\n      bot.dispatchHelper(\"register\", interaction);\r\n     },\r\n   });\r\n   ```\r\n\r\n4. Creating Event files\r\n\r\n    ```js\r\n    // src/events/clientReady.js\r\n    import { Discrafter } from \"@dan_koyuki/discrafterjs\"\r\n\r\n    export default Discrafter.Event({\r\n      name: \"clientReady\",\r\n      once: true,\r\n      execute: async () => {\r\n        console.log(`Bot logged in successfully as ${this.client.user?.tag}.`);\r\n      }\r\n    })\r\n    ```\r\n\r\n5. Creating Helper Function files\r\n\r\n    ```js\r\n    // src/helpers/register.js\r\n\r\n    import {Discrafter} from \"@dan_koyuki/discrafterjs\"\r\n\r\n    export default Discrafter.Helper({\r\n      name: \"register\",\r\n      type: \"Interaction\",\r\n      execute: async (interaction) => {\r\n        console.log(\"Hello, im here to help abstracting register function\");\r\n      }\r\n    })\r\n    ```\r\n\r\n## FAQ\r\n1. I want to add my own handlers, how do i do that?\r\n    ```js\r\n    \"As for current version, the framework doesnt handle the case. However, you can simply turn off the useDefaultHandler on any handler you dont want and call your own handler after creating the bot.\"\r\n    ```\r\n   \r\n## Roadmap\r\n- ~~v0.3: Documentation & helper function handler~~ (Done)\r\n- v0.3.5: Colorized logging (might or might not be skipped or moved)\r\n- ~~v0.4: MongoDB Configuration Support~~ (Scrapped/Moved to different package as plugin)\r\n- v0.5: Plugin/extension support (e.g., RPGTamerDiscrafter)\r\n  \r\n## Contributing\r\nContributions, issues, and feature requests are welcome!  \r\nFeel free to open an issue or PR on [GitHub](https://github.com/Danang-Bahtiar/DiscrafterJS).\r\n\r\n## License\r\nMIT © [Dan](https://github.com/Danang-Bahtiar)","readmeFilename":"README.md"}