{"id":22499702,"url":"https://github.com/distype/cmd","last_synced_at":"2026-04-27T18:03:11.218Z","repository":{"id":57681968,"uuid":"482117465","full_name":"distype/cmd","owner":"distype","description":"A command handler for Distype.","archived":false,"fork":false,"pushed_at":"2025-07-01T01:05:38.000Z","size":951,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T09:05:32.882Z","etag":null,"topics":["bot","commands","discord","discord-api","discord-bot","discordapp","distype"],"latest_commit_sha":null,"homepage":"https://distypecmd.br88c.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/distype.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}},"created_at":"2022-04-16T00:26:11.000Z","updated_at":"2025-07-01T01:04:20.000Z","dependencies_parsed_at":"2022-09-10T15:01:18.345Z","dependency_job_id":null,"html_url":"https://github.com/distype/cmd","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/distype/cmd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distype%2Fcmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distype%2Fcmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distype%2Fcmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distype%2Fcmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/distype","download_url":"https://codeload.github.com/distype/cmd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distype%2Fcmd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32348058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bot","commands","discord","discord-api","discord-bot","discordapp","distype"],"created_at":"2024-12-06T22:15:04.839Z","updated_at":"2026-04-27T18:03:11.208Z","avatar_url":"https://github.com/distype.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003ch1\u003e@distype/cmd\u003c/h1\u003e\n    \u003cp\u003e\n        \u003ca href=\"https://www.npmjs.com/package/@distype/cmd\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@distype/cmd.svg?color=5162F\u0026style=for-the-badge\u0026logo=npm\"\u003e\u003c/a\u003e\n        \u003ca href=\"https://github.com/distype/cmd/actions/workflows/tests.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/distype/cmd/tests.yml?style=for-the-badge\u0026logo=github\u0026label=Tests\"\u003e\u003ca\u003e\n        \u003ca href=\"https://discord.gg/E2JsYPPJYN\"\u003e\u003cimg src=\"https://img.shields.io/discord/773939670505619486?color=5162F1\u0026style=for-the-badge\u0026logo=discord\u0026logoColor=white\"\u003e\u003c/a\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\n## About\n\nA command handler for [Distype](https://github.com/distype/distype).\n\n## How it works\n\nCommands are made via builders ([example below](https://github.com/distype/cmd/blob/main/README.md#example-bot)), and are then pushed to the command handler to be executed whenever an interaction is received. This library also includes builders for other components, including embeds, modals, and message components.\n\nCommand execute methods use a command context to allow you to access useful variables, such as the client and information about the command.\n\n![img](https://raw.githubusercontent.com/distype/assets/main/cmd.gif)\n\u003e Command parameters are dynamically typed on the command context\n\n## Example Bot\n\n```ts\nimport { Client } from 'distype';\nimport { CommandHandler } from '@distype/cmd';\n\nconst client = new Client(YOUR_BOT_TOKEN);\n\n// Create the command handler.\nconst commandHandler = new CommandHandler(client);\n\n// Create a command.\nconst fooCommand = new ChatCommand()\n    .setName(`foo`)\n    .setDescription(`Foo command`)\n    .addStringParameter(true, `bar`, `Describe bar`)\n    .addUserParameter(true, `baz`, `Which user is baz?`)\n    .setExecute((ctx) =\u003e {\n        ctx.send(`You said bar is \"${ctx.parameters.bar}\", and that ${ctx.parameters.baz.user.username} is baz!`);\n    });\n\n// Save the foo command to the command handler.\ncommandHandler.bindCommand(fooCommand);\n\nclient.gateway.on(`SHARDS_RUNNING`, () =\u003e {\n    // Pushes saved commands to your application.\n    commandHandler.push();\n});\n\nclient.gateway.connect();\n```\n\n\u003e Note that Discord API typings are for API version `10`, and are from [discord-api-types](https://www.npmjs.com/package/discord-api-types). While you can still specify different API versions to be used, it is not recommended.\n\n## Installation\n\n`@distype/cmd` can be installed via npm.\n```sh\nnpm install @distype/cmd\n```\n\n### Prerequisites\n\n- **[Node.js \u003e=24.3.0](https://nodejs.org/)**\n- **[NPM \u003e=11.4.2](https://www.npmjs.com/)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistype%2Fcmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdistype%2Fcmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistype%2Fcmd/lists"}