{"id":15021694,"url":"https://github.com/fuma-nama/discord-fp","last_synced_at":"2026-02-19T02:00:39.662Z","repository":{"id":65487447,"uuid":"591719329","full_name":"fuma-nama/discord-fp","owner":"fuma-nama","description":"A Beautiful Application Command Library for Discord.js and Discordeno","archived":false,"fork":false,"pushed_at":"2023-04-25T13:26:10.000Z","size":323,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-13T09:54:39.184Z","etag":null,"topics":["application-command","discord","discord-bot-framework","discord-framework","discord-js","discord-library","discordeno","javascript","javascript-library","library","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@discord-fp/djs","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/fuma-nama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-21T16:46:30.000Z","updated_at":"2025-07-07T10:18:13.000Z","dependencies_parsed_at":"2023-09-16T23:09:06.651Z","dependency_job_id":null,"html_url":"https://github.com/fuma-nama/discord-fp","commit_stats":null,"previous_names":["fuma-nama/discord-fp","sonmoosans/discord-fp"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/fuma-nama/discord-fp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuma-nama%2Fdiscord-fp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuma-nama%2Fdiscord-fp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuma-nama%2Fdiscord-fp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuma-nama%2Fdiscord-fp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuma-nama","download_url":"https://codeload.github.com/fuma-nama/discord-fp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuma-nama%2Fdiscord-fp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29600840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T00:59:38.239Z","status":"online","status_checked_at":"2026-02-19T02:00:07.702Z","response_time":117,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["application-command","discord","discord-bot-framework","discord-framework","discord-js","discord-library","discordeno","javascript","javascript-library","library","typescript"],"created_at":"2024-09-24T19:56:54.736Z","updated_at":"2026-02-19T02:00:39.548Z","avatar_url":"https://github.com/fuma-nama.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"logo\" src=\"./document/logo.png\" width=\"200\" /\u003e\n    \u003ch1 align=\"center\"\u003eDiscord-FP\u003c/h1\u003e\n    \u003cp align=\"center\"\u003eA Beautiful Application Command Framework For \u003cb\u003eDiscordeno \u0026 Discord.js\u003c/b\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n## Features\n\n-   **Type-safe**\n-   Light-weight\n-   High performance\n-   Auto-complete \u0026 Middlewares\n-   File-system Based\n-   Beautiful code with Functional Programming\n-   Support both **Discordeno and Discord.js**\n-   Compatible with **ESM and CommonJS**\n\n## Install\n\n### Discordeno\n\nRefer to [here](./packages/discordeno/README.md) for Documentation of Discord-FP for discordeno\n\n```\nnpm install @discord-fp/discordeno\n```\n\n### Discord.js\n\n```\nnpm install @discord-fp/djs\n```\n\n\u003e **Note** \u003cbr /\u003e\n\u003e Example below uses commonjs + typescript + import alias \u003cbr /\u003e\n\u003e you may convert it into normal common js syntax yourself\n\n## Slash command in the Best way\n\nStop writing lots of `interaction.options.get(\"name\")` just for getting the value of an option\n\nLet us handle **everything!**\n\n```typescript\nimport { options } from \"@discord-fp/djs\";\nimport { command } from \"@/utils/dfp\";\n\nexport default command.slash({\n    description: \"Say Hello to you\",\n    options: {\n        name: options.string({\n            description: \"Your name\",\n        }),\n    },\n    execute: async ({ event, options }) =\u003e {\n        await event.reply(`Hello, ${options.name}`);\n    },\n});\n```\n\n## Find your Command _Instantly_\n\nTired of finding your command all the place? All commands are file-system based!\n\nSearch file by name, you are able to find your command **instantly**\n\nFor slash command: `test hello`\n\n\u003e commands/test/\\_meta.ts\n\n```ts\nimport { command } from \"@/utils/dfp\";\n\nexport default command.group({\n    description: \"Your Command Group description\",\n});\n```\n\n\u003e commands/test/hello.ts\n\n```ts\nimport { command } from \"@/utils/dfp\";\n\nexport default command.slash({\n    //...\n});\n```\n\n## Powerful \u0026 Beautiful\n\nNot just slash commands, you are able to create context menu commands with **few lines of code**\n\n\u003e commands/Delete Message.ts\n\n```ts\nimport { command } from \"@/utils/dfp\";\n\nexport default command.message({\n    async execute({ event }) {\n        await event.reply(\"I don't wanna delete message!\");\n    },\n});\n```\n\n## Middleware\n\nWanted to run something before executing a command?\n\nWith middleware, you can control how an event handler being fired, or pass context to the handler\n\n\u003e utils/dfp.ts\n\n```ts\nimport { initDiscordFP } from \"@discord-fp/djs\";\n\nexport const dfp = initDiscordFP();\nexport const command = dfp.command;\n\n//Don't return anything to prevent calling the handler\nexport const protectedCommand = command.middleware(({ event, next }) =\u003e {\n    return next({\n        ctx: {\n            message: \"hello world\",\n        },\n        event,\n    });\n});\n```\n\n\u003e commands/your-command.ts\n\n```ts\nimport { protectedCommand } from \"@/utils/dfp\";\n\nexport default protectedCommand.slash({ ... })\n```\n\n## Everything is Type-safe + Null-safe\n\nFrom config, middleware context, to options values, It's all type-safe!\n\n```ts\nexport default command.slash({\n    description: \"Say Hello to you\",\n    options: {\n        enabled: options.boolean({\n            description: \"Enabled\",\n            required: false,\n        }),\n        number: options.number({\n            description: \"Example number\",\n            required: true,\n        }),\n    },\n    //...\n});\n```\n\nTake a look at `options`:\n\n```\n(parameter) options: {\n    enabled: boolean | null;\n    number: number;\n}\n```\n\n## Getting Started\n\nTry our [template](https://github.com/SonMooSans/discord-bot-starter) which includes everything you need\n\n| Discord.js                       | Discordeno                              |\n| -------------------------------- | --------------------------------------- |\n| [Docs](./packages/djs/README.md) | [Docs](./packages/discordeno/README.md) |\n\n## ESM Usage\n\nESM has been supported since v0.2.1\n\n\u003e **Note** \u003cbr /\u003e\n\u003e If you have any problems with relative path, you may pass an absolute path instead\n\n### Common js\n\n```ts\nconst { ... } = require(\"@discord-fp/djs\");\n```\n\n### ESM\n\n```ts\nimport { ... } from \"@discord-fp/djs\";\n```\n\n## Any issues?\n\nFeel free to open an issue! \u003cbr /\u003e\nGive this repo a star if you loved this library\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuma-nama%2Fdiscord-fp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuma-nama%2Fdiscord-fp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuma-nama%2Fdiscord-fp/lists"}