
@nyx-discord/djs is the discord.js adapter for nyx, a
Discord bot framework that stays out of your way. It handles application commands, components, events, schedules and
plugins on top of your discord.js client.
It re-exports everything from @nyx-discord/base, so it's the only nyx package you need to install.
npm i @nyx-discord/djs discord.js
import { AbstractStandaloneCommand, Bot } from '@nyx-discord/djs';
import { Client, GatewayIntentBits, SlashCommandBuilder, type ChatInputCommandInteraction } from 'discord.js';
class PingCommand extends AbstractStandaloneCommand {
protected readonly data = new SlashCommandBuilder().setName('ping').setDescription('Pong!').toJSON();
public async execute(interaction: ChatInputCommandInteraction) {
await interaction.reply('Pong!');
}
}
const bot = Bot.create(() => ({
token: process.env['DISCORD_TOKEN']!,
client: new Client({ intents: [GatewayIntentBits.Guilds] }),
logger: console,
deployCommands: true,
}));
await bot.getCommandManager().addCommands(new PingCommand());
await bot.start();
@nyx-discord/loaders: load commands, events and schedules
from directories.@nyx-discord/plugin-sessions: long-lived interactive
flows (pagination, wizards, menus).@nyx-discord/typed-options: slash command options typed
from the command data.npx skills add nyx-discord/nyx.