{"id":22704840,"url":"https://github.com/proxitystudios/discord-bot-starter-js","last_synced_at":"2025-06-12T08:33:13.460Z","repository":{"id":221199838,"uuid":"753722179","full_name":"ProxityStudios/discord-bot-starter-js","owner":"ProxityStudios","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-18T20:37:15.000Z","size":93,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T20:25:24.412Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProxityStudios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-06T17:10:24.000Z","updated_at":"2024-02-06T17:45:47.000Z","dependencies_parsed_at":"2024-02-06T18:30:46.854Z","dependency_job_id":"3a396719-04fc-461c-9e71-8d3c9250fab8","html_url":"https://github.com/ProxityStudios/discord-bot-starter-js","commit_stats":null,"previous_names":["proxitystudios/discord-bot-starter-js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ProxityStudios/discord-bot-starter-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProxityStudios%2Fdiscord-bot-starter-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProxityStudios%2Fdiscord-bot-starter-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProxityStudios%2Fdiscord-bot-starter-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProxityStudios%2Fdiscord-bot-starter-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProxityStudios","download_url":"https://codeload.github.com/ProxityStudios/discord-bot-starter-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProxityStudios%2Fdiscord-bot-starter-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259430173,"owners_count":22856198,"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","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":[],"created_at":"2024-12-10T09:08:10.247Z","updated_at":"2025-06-12T08:33:13.442Z","avatar_url":"https://github.com/ProxityStudios.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Bot Starter TS\n\nThis is a TypeScript template for creating Discord bots using the [discord.js](https://discord.js.org/) library. It provides a basic structure and some useful features to help you get started quickly and easily.\n\n## How to use\n\n1. Clone or download this repository\n2. Run `npm install` to install the required packages\n3. Rename `.env.example` to `.env` and fill out everything\n4. Run `npm run dev` to start the bot in development mode\n5. Write your bot logic in the `src` folder\n\n## Scripts\n\n### Development mode\n\n```bash\nnpm run dev\n```\n\nStarts the bot using `ts-node-dev`, which auto-restarts on code changes.\n\n### Production mode\n\n```bash\nnpm start\n```\n\nCompiles TypeScript to JavaScript and starts the bot using `ts-node`.\n\n## Features\n\n### Command handler\n\nA flexible and modular way to create and manage commands for your bot. You can add new commands by creating a file in the `src/commands` folder that follows this structure:\n\n```typescript\nexport default class extends Command {\n  public constructor(client: CustomClient) {\n    super(client, {\n      // The name of the command\n      name: CommandName.Example,\n      // A brief description of what the command does\n      description: \"This is an example description.\",\n      // The category of the command\n      category: CommandCategory.General,\n    });\n  }\n\n  public async execute(\n    interaction: ChatInputCommandInteraction\n  ): Promise\u003cvoid\u003e {\n    // Command logic goes here\n    await interaction.reply({\n      content: `This is an example answer.`,\n    });\n  }\n}\n```\n\nYou can also organize your commands into subfolders based on their categories. For example, you can create a file in `src/commands/moderation/ban.ts` for a ban command. However, you will need to add the new command name and category to the `types.ts` file as well. For example:\n\n```typescript\nexport enum CommandName {\n  // ...\n  // Moderation\n  Ban = \"ban\",\n}\n\nexport enum CommandCategory {\n  // ...\n  Moderation = \"Moderation\",\n}\n```\n\n### Slash commands\n\nYou can create slash command options by using `this.data` property. For example, this is how you can add a `String` option:\n\n```typescript\nsuper(client, {\n  // ...\n});\n\n// Creating slash command options\nthis.data.addStringOption((option) =\u003e\n  option\n    .setName(\"input\")\n    .setDescription(\"The input to echo back\")\n    .setRequired(true)\n);\n```\n\nTo use the options, you need to access them from the `interaction.options` property. For example, this is how you can get the value of the `String` option in your execute method:\n\n```typescript\npublic async execute(\n  interaction: ChatInputCommandInteraction\n): Promise\u003cvoid\u003e {\n  // The logic of the slash command goes here\n  const input = interaction.options.getString(\"input\");\n  await interaction.reply({\n    content: `You said: ${input}`,\n  });\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproxitystudios%2Fdiscord-bot-starter-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproxitystudios%2Fdiscord-bot-starter-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproxitystudios%2Fdiscord-bot-starter-js/lists"}