{"id":16497976,"url":"https://github.com/dan5py/discordjs-template-ts","last_synced_at":"2025-10-09T14:34:46.320Z","repository":{"id":170405349,"uuid":"646545669","full_name":"dan5py/discordjs-template-ts","owner":"dan5py","description":"A simple bot template for discordjs (with Typescript)","archived":false,"fork":false,"pushed_at":"2024-08-05T14:39:25.000Z","size":89,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-13T08:47:49.960Z","etag":null,"topics":["discord","discord-bot","discord-bot-template","discord-bot-template-ts","discord-command-handler","discord-js","discord-js-v14","discordjs-command-handler","discordjs-event-handler","discordjs-template","discordjs-v14","typescript"],"latest_commit_sha":null,"homepage":"https://dan5py.github.io/discordjs-template-ts/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dan5py.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-28T18:32:05.000Z","updated_at":"2025-05-20T02:06:02.000Z","dependencies_parsed_at":"2024-08-05T16:55:40.325Z","dependency_job_id":null,"html_url":"https://github.com/dan5py/discordjs-template-ts","commit_stats":null,"previous_names":["dan5py/discordjs-template-ts","dan5py/discordjs14-ts"],"tags_count":6,"template":true,"template_full_name":null,"purl":"pkg:github/dan5py/discordjs-template-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan5py%2Fdiscordjs-template-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan5py%2Fdiscordjs-template-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan5py%2Fdiscordjs-template-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan5py%2Fdiscordjs-template-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dan5py","download_url":"https://codeload.github.com/dan5py/discordjs-template-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dan5py%2Fdiscordjs-template-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001513,"owners_count":26083118,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":["discord","discord-bot","discord-bot-template","discord-bot-template-ts","discord-command-handler","discord-js","discord-js-v14","discordjs-command-handler","discordjs-event-handler","discordjs-template","discordjs-v14","typescript"],"created_at":"2024-10-11T14:46:40.740Z","updated_at":"2025-10-09T14:34:46.289Z","avatar_url":"https://github.com/dan5py.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DiscordJS Bot Template\n\n\u003e Updated to discord.js v14.14.1\n\n## About\n\nThis is a template for a DiscordJS v14 bot. It is written in TypeScript and uses [DiscordJS](https://discord.js.org/#/) as the library for interacting with Discord.\n\n## Setup\n\n\u003e **Note**\n\u003e This project uses [pnpm](https://pnpm.io/) as the package manager. You can use `npm` or `yarn` if you prefer.\n\n1. Clone the repository\n2. Run `pnpm i` to install dependencies\n3. Copy `.env.example` to `.env` and fill in the values\n4. Run `pnpm dev` to start the bot in development mode\n5. Run `pnpm build` to build the bot\n6. Run `pnpm start` to start the bot in production mode\n\n## Usage\n\n### Add Slash commands\n\n1. Create a `.ts` file in `src/commands/slash` with the same name as the command (in the relative subfolder if in a category)\n\nThe command will be automatically registered when the bot starts.\n\n### Creating a command file\n\nYou can create a new command using `TypeScript`.\n\nThe file must export the following object:\n\n```ts\nimport { SlashCommand, SlashCommandConfig } from '@/types/command';\n\nconst config: SlashCommandConfig = {\n  ...\n};\n\nconst command: SlashCommand = {\n  ...\n};\n\nexport default { command, config };\n```\n\n\u003e [!NOTE]\n\u003e You can see all the types definition in `src/types/command.ts`.\n\n#### SlashCommandConfig\n\nThe `config` of the command contains all the information about the command that will be loaded.\n\n| Property    | Type             | Required | Description                                                           |\n| ----------- | ---------------- | -------- | --------------------------------------------------------------------- |\n| name        | `string`         | No       | The name of the command. If not defined, the filename is used instead |\n| description | `string`         | Yes      | The description of the command.                                       |\n| usage       | `string`         | No       | The usage of the command.                                             |\n| category    | `string`         | No       | The category of the command.                                          |\n| nsfw        | `boolean`        | No       | Whether this command is NSFW or not (Default: false).                 |\n| options     | `Array\u003cOptions\u003e` | No       | The list of options for this command. (see [](/#options))             |\n\n\u003e [!IMPORTANT]\n\u003e The `fileName` property is automatically added to the config object, DO NOT add it manually.\n\n#### SlashCommand\n\nThe `command` object contains the function that will be executed when the command is called.\nIt also contains the `permissions` for the command. (see [Permissions Guide](https://discordjs.guide/popular-topics/permissions.html#permissions))\n\n#### Options\n\nThe list of options for this command.\n\n| Property    | Type             | Required | Description                                               | Valid in Types                |\n| ----------- | ---------------- | -------- | --------------------------------------------------------- | ----------------------------- |\n| name        | `string`         | Yes      | The name of the option.                                   | All                           |\n| description | `string`         | Yes      | The description of the option.                            | All                           |\n| type        | `string`         | Yes      | The type of the option. See [Option Types](#option-types) | All                           |\n| required    | `boolean`        | No       | Whether this option is required or not (Default: false).  | All                           |\n| choices     | `Array\u003cChoices\u003e` | No       | The list of choices for this option.                      | `INTEGER \\| NUMBER \\| STRING` |\n| minValue    | `number`         | No       | The minimum value of the option.                          | `INTEGER \\| NUMBER`           |\n| maxValue    | `number`         | No       | The maximum value of the option.                          | `INTEGER \\| NUMBER`           |\n\n##### Choice Properties\n\nThe properties of each choice within the `choices` array.\n\n| Property | Type               | Description                                                                         |\n| -------- | ------------------ | ----------------------------------------------------------------------------------- |\n| name     | `string`           | The name of the choice.                                                             |\n| value    | `string \\| number` | The value of the choice (the available value is based on the off the option value). |\n\n#### Option Types\n\nFor further information on option types, see the [Discord documentation](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type).\n\n| Type          | Description                      |\n| ------------- | -------------------------------- |\n| `STRING`      | Represents a string value.       |\n| `BOOLEAN`     | Represents a boolean value.      |\n| `NUMBER`      | Represents a numeric value.      |\n| `INTEGER`     | Represents an integer value.     |\n| `ROLE`        | Represents a role.               |\n| `USER`        | Represents a user.               |\n| `CHANNEL`     | Represents a channel.            |\n| `MENTIONABLE` | Represents a mentionable entity. |\n| `ATTACHMENT`  | Represents an attachment.        |\n\n### Events\n\nEvents are automatically registered when the bot starts. To add an event, create a file in `src/events/\u003cevent_source\u003e` with the name of the event and export default the event function.\n\n| Event Source | Description                                   |\n| ------------ | --------------------------------------------- |\n| `client`     | Events emitted by the client (e.g. ready)     |\n| `guild`      | Events emitted by a guild (e.g. interactions) |\n\nSee the [DiscordJS documentation](https://old.discordjs.dev/#/docs/discord.js/main/typedef/Events) for a list of events.\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\n[ISC](https://choosealicense.com/licenses/isc/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan5py%2Fdiscordjs-template-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdan5py%2Fdiscordjs-template-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan5py%2Fdiscordjs-template-ts/lists"}