{"id":26528885,"url":"https://github.com/twobrake/discord-bot-template","last_synced_at":"2026-05-09T00:48:21.611Z","repository":{"id":283155851,"uuid":"946958719","full_name":"TwoBrake/discord-bot-template","owner":"TwoBrake","description":"A simple Discord bot starter template written in TypeScript.","archived":false,"fork":false,"pushed_at":"2025-03-18T20:06:02.000Z","size":103,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T21:22:41.522Z","etag":null,"topics":["bot","discord","discordjs","typescript"],"latest_commit_sha":null,"homepage":"https://lucastranks.com","language":"TypeScript","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/TwoBrake.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,"publiccode":null,"codemeta":null}},"created_at":"2025-03-12T00:05:59.000Z","updated_at":"2025-03-18T20:06:05.000Z","dependencies_parsed_at":"2025-03-18T21:34:12.095Z","dependency_job_id":null,"html_url":"https://github.com/TwoBrake/discord-bot-template","commit_stats":null,"previous_names":["twobrake/discord-bot-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoBrake%2Fdiscord-bot-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoBrake%2Fdiscord-bot-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoBrake%2Fdiscord-bot-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoBrake%2Fdiscord-bot-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TwoBrake","download_url":"https://codeload.github.com/TwoBrake/discord-bot-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244825655,"owners_count":20516592,"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":["bot","discord","discordjs","typescript"],"created_at":"2025-03-21T16:19:02.351Z","updated_at":"2026-05-09T00:48:21.580Z","avatar_url":"https://github.com/TwoBrake.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Bot Template\n\nA simple template for a Discord bot utilizing the [**Discord.js**](https://discord.js.org) framework. Completely written in **TypeScript**.\n\n## Features\n\n- **Command Handler**: Easily create and manage commands.\n- **Event Handler**: Automatically load and handle events.\n- **TypeScript**: Utilize the power of TypeScript.\n- **Configuration**: Easy access to configuration values.\n- **Logging**: Simple and easy to read logging system.\n- and more...\n\n## Getting Started\n\n1. Clone the repository: `git clone https://github.com/TwoBrake/discord-bot-template`.\n2. Install dependencies:\n\n```bash\nnpm install\n```\n\n3. Initialize your local environment files by cloning the example file and initialize your configuration from the example:\n\n```bash\ncp .env.example .env \u0026\u0026 cp config/example.bot.ts config/bot.ts\n```\n\n4. It's as simple as that! You can now start the bot:\n\n```bash\nnpm run dev\n```\n\nor in production:\n\n```bash\nnpm run build \u0026\u0026 npm run start\n```\n\n## Documentation\n\nThis is a template for developing Discord bots using the Discord.js framework, however, we have built our own internal methods and functions to make the development process as simple as possible. This article will cover the basics of some of these methods and functions.\n\n**ComponentListener**:\nThis class allows you to listen for component interactions such as button clicks and modal submits.\n\n```typescript\nimport ComponentListener, {\n  ComponentListenerEvent,\n} from \"../path/to/ComponentListener\";\n\nconst event = new ComponentListener(\"myId\", ComponentListenerInteraction.Modal);\n\nevent.on(\n  ComponentListenerEvent.OnCreate,\n  async (interaction: ModalSubmitInteraction) =\u003e {\n    await interaction.reply(\"We have received your submission!\");\n  }\n);\n```\n\n**Commands**:\nThis class allows you to define different directories for your commands and automatically load them.\n\n```typescript\nimport Commands from \"../path/to/Commands\";\n\nconst commands = new Commands(\"src/commands\");\ncommands.load(); // Loads all commands.\ncommands.refresh(); // Reloads all commands.\n```\n\n**Events**:\nThis class allows you to define different directories for your events and automatically load them.\n\n```typescript\nimport Events from \"../path/to/Events\";\n\nconst events = new Events(\"src/events\");\nevents.load(); // Loads all events.\n```\n\n**Command**:\nThis class allows you to define a command, its properties, and its execution.\n\n```typescript\nimport Command from \"../path/to/Command\";\n\nexport default new Command({\n  data: new SlashCommandBuilder()\n    .setName(\"ping\")\n    .setDescription(\"Replies with Pong!\"),\n  execute: async (interaction: CommandInteraction) =\u003e {\n    await interaction.reply(\"Pong!\");\n  },\n});\n```\n\n**Event**:\nThis class allows you to define an event and its execution.\n\n```typescript\nimport Event from \"../path/to/Event\";\n\nexport default new Event({\n  event: Events.ClientReady,\n  once: true,\n  execute: (client: Client) =\u003e {\n    console.log(`Logged in as ${client.user?.tag}`);\n  },\n});\n```\n\n**AccessManager**:\nThis class allows you to manage access to commands and events.\n\n```typescript\nimport AccessManager from \"../path/to/AccessManager\";\n\nconst auth = new AccessManager(interaction, {\n  ownerOnly: true,\n});\n\nif (!auth.has()) return; // Authorization failed.\n\nauth.restrict(() =\u003e {\n  console.log(\"You can also do it like this!\");\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwobrake%2Fdiscord-bot-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwobrake%2Fdiscord-bot-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwobrake%2Fdiscord-bot-template/lists"}