├── .env.example ├── .gitignore ├── commandkit.config.cjs ├── package.json └── src ├── commands └── ping.js ├── events └── ready │ └── log.js └── index.js /.env.example: -------------------------------------------------------------------------------- 1 | TOKEN = '' -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .commandkit 4 | .env 5 | .DS_Store -------------------------------------------------------------------------------- /commandkit.config.cjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | const { defineConfig } = require('commandkit'); 4 | 5 | module.exports = defineConfig({ 6 | src: 'src', 7 | main: 'index.mjs', 8 | }); 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "commandkit-starter-files", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "commandkit dev", 6 | "build": "commandkit build", 7 | "start": "commandkit start" 8 | }, 9 | "dependencies": { 10 | "commandkit": "^0.1.10", 11 | "discord.js": "^14.19.3", 12 | "dotenv": "^16.5.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/commands/ping.js: -------------------------------------------------------------------------------- 1 | /** @type {import('commandkit').CommandData} */ 2 | const data = { 3 | name: 'ping', 4 | description: 'Pong!', 5 | }; 6 | 7 | /** @param {import('commandkit').SlashCommandProps} param0 */ 8 | function run({ interaction, client }) { 9 | interaction.reply(`:ping_pong: Pong! ${client.ws.ping}ms`); 10 | } 11 | 12 | /** @type {import('commandkit').CommandOptions} */ 13 | const options = {}; 14 | 15 | module.exports = { data, run, options }; 16 | -------------------------------------------------------------------------------- /src/events/ready/log.js: -------------------------------------------------------------------------------- 1 | module.exports = (client) => { 2 | console.log(`Logged in as ${client.user.username}`); 3 | }; 4 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | require('dotenv/config'); 2 | 3 | const { Client } = require('discord.js'); 4 | const { CommandKit } = require('commandkit'); 5 | 6 | const client = new Client({ 7 | intents: ['Guilds', 'GuildMembers', 'GuildMessages', 'MessageContent'], 8 | }); 9 | 10 | new CommandKit({ 11 | client, 12 | commandsPath: `${__dirname}/commands`, 13 | eventsPath: `${__dirname}/events`, 14 | bulkRegister: true, 15 | }); 16 | 17 | client.login(process.env.TOKEN); 18 | --------------------------------------------------------------------------------