{"id":15830084,"url":"https://github.com/imoxto/cordcommand","last_synced_at":"2025-04-01T11:13:51.396Z","repository":{"id":58301480,"uuid":"530740932","full_name":"imoxto/cordcommand","owner":"imoxto","description":"A utility package for making discord-bot commands much easier to write with discord.js","archived":false,"fork":false,"pushed_at":"2022-08-31T16:38:22.000Z","size":34,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-12T11:12:37.253Z","etag":null,"topics":["command-handler","discord-bot","discord-js","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cordcommand","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/imoxto.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-08-30T16:31:54.000Z","updated_at":"2022-09-01T05:56:47.000Z","dependencies_parsed_at":"2022-08-31T18:31:54.267Z","dependency_job_id":null,"html_url":"https://github.com/imoxto/cordcommand","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imoxto%2Fcordcommand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imoxto%2Fcordcommand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imoxto%2Fcordcommand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imoxto%2Fcordcommand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imoxto","download_url":"https://codeload.github.com/imoxto/cordcommand/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246628229,"owners_count":20808106,"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":["command-handler","discord-bot","discord-js","typescript"],"created_at":"2024-10-05T11:04:32.048Z","updated_at":"2025-04-01T11:13:51.371Z","avatar_url":"https://github.com/imoxto.png","language":"TypeScript","readme":"# Cordcommand\n\n## About\nA utility package for making discord-bot commands much easier to write with discord.js.\n\n## Usage Example\n\n```js\n// initiate discord.js client\nconst client = new Client({\n  intents: [\n    GatewayIntentBits.Guilds,\n    GatewayIntentBits.GuildMessages,\n    GatewayIntentBits.MessageContent,\n    GatewayIntentBits.GuildMembers,\n  ],\n});\n\n// define your commands similar to\nconst commands: MessageCommand[] = [\n  {\n    regex: /ping/i,\n    message: \"pong\",\n  },\n  {\n    regex: /hi/i,\n    // message can also be a callback function which can access the discord message object\n    message: (_, message) =\u003e `hello \u003c@${message.author.id}\u003e`,\n  },\n  {\n    regex: /bye/i,\n    message: (_, message) =\u003e `bye ${message.author.username}`,\n    reply: true, // uses discord's message.reply intead of just sending the message in the same channel\n  },\n  {\n    regex: /args/i,\n    message: (args) =\u003e `The arguments are: ${args.join(\", \")}`,\n    reply: true, \n  },\n];\n\n// add commands to the client by calling the addCommands function provided by the client\naddCommands(client, commands, {\n  messageCommandPrefix: /^i!/i,\n  // Add your command prefix regex. Make sure to include ^ (starts with) in the regex\n});\n\n// login\nclient.login(process.env.BOT_TOKEN!);\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimoxto%2Fcordcommand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimoxto%2Fcordcommand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimoxto%2Fcordcommand/lists"}