light-jo
v1.0.0
Published
A lightweight discord.js command handler with hot-reload support.
Maintainers
Readme
light-jo
discord.js 向けの軽量なコマンドハンドラー。 ファイルの変更を検知して、Botを再起動せずにコマンドを即座に反映(ホットリロード)します。
特徴
- 設定不要: 導入してすぐに使えます。
- ホットリロード: コマンドファイルを保存するとミリ秒で反映。
- サブ対応: 自動スキャン。
導入方法
GitHubから直接インストールする
npm install github:nero-developer/light-jo
使い方
const { Client, GatewayIntentBits } = require('discord.js'); const LightJo = require('light-jo');
const client = new Client({ intents: [7796] }); // 必要最低限のインテント
new LightJo(client, { commandsDir: './commands', autoReload: true });
client.on('messageCreate', async message => { if (message.author.bot || !message.content.startsWith('!')) return; const args = message.content.slice(1).trim().split(/ +/); const command = client.commands.get(args.shift().toLowerCase()); if (command) command.execute(message, args, client); });
client.login('TOKEN');
コマンド例
module.exports = { data: { name: 'ping' }, async execute(message) { message.reply('png'); } };
