
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
slacmdregistry
Advanced tools
A modular slash command registry for Discord bots using Discord.js v14+. Handles dynamic loading and registration of commands with minimal setup.
A modular slash command registry for Discord bots using Discord.js v14+.
Handles dynamic loading and registration of commands with minimal setup.
npm install slacmdregistry
Usage
const { deploy } = require('slacmdregistry');
deploy({
scope: 'global', // or 'guild'
guildId: 'YOUR_GUILD_ID', // required if scope is 'guild'
path: './commands',
log: true
});
Command Format
Each command lives in its own file inside /commands. Example:
// commands/ping.js
module.exports = {
name: 'ping',
description: 'Replies with Pong!',
options: [],
async execute(interaction) {
await interaction.reply('Pong!');
}
};
Examples
Kick Command
// commands/kick.js
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'kick',
description: 'Kick a user from the server',
options: [
{
name: 'user',
description: 'The user to kick',
type: 6,
required: true
},
{
name: 'reason',
description: 'Reason for kick',
type: 3
}
],
async execute(interaction) {
const user = interaction.options.getUser('user');
const reason = interaction.options.getString('reason') || 'No reason provided';
const member = interaction.guild.members.cache.get(user.id);
if (!member) {
return interaction.reply({ content: 'User not found.', ephemeral: true });
}
try {
await member.kick(reason);
const embed = new EmbedBuilder()
.setTitle('User Kicked')
.setColor(0xff0000)
.addFields(
{ name: 'User', value: user.tag, inline: true },
{ name: 'Moderator', value: interaction.user.tag, inline: true },
{ name: 'Reason', value: reason }
)
.setThumbnail(user.displayAvatarURL({ dynamic: true }))
.setTimestamp();
await interaction.reply({ embeds: [embed] });
} catch (err) {
await interaction.reply({ content: `Failed to kick: ${err.message}`, ephemeral: true });
}
}
};
Ban Command
// commands/ban.js
module.exports = {
name: 'ban',
description: 'Ban a user from the server',
options: [
{
name: 'user',
description: 'The user to ban',
type: 6,
required: true
},
{
name: 'reason',
description: 'Reason for ban',
type: 3
}
],
async execute(interaction) {
const user = interaction.options.getUser('user');
const reason = interaction.options.getString('reason') || 'No reason provided';
const member = interaction.guild.members.cache.get(user.id);
if (!member) {
return interaction.reply({ content: 'User not found.', ephemeral: true });
}
try {
await member.ban({ reason });
await interaction.reply(`Banned ${user.tag} for: ${reason}`);
} catch (err) {
await interaction.reply({ content: `Failed to ban: ${err.message}`, ephemeral: true });
}
}
};
Embed-Only Command
// commands/serverinfo.js
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'serverinfo',
description: 'Shows server information',
options: [],
async execute(interaction) {
const { guild } = interaction;
const embed = new EmbedBuilder()
.setTitle('Server Info')
.setColor(0x00bfff)
.addFields(
{ name: 'Name', value: guild.name, inline: true },
{ name: 'Members', value: `${guild.memberCount}`, inline: true }
)
.setThumbnail(guild.iconURL({ dynamic: true }))
.setTimestamp();
await interaction.reply({ embeds: [embed] });
}
};
Features
- Supports both global and guild slash commands
- Loads commands dynamically from a folder
- Embed-friendly and option-rich
- Minimal setup, maximum control
License
MIT
FAQs
A modular slash command registry for Discord bots using Discord.js v14+. Handles dynamic loading and registration of commands with minimal setup.
We found that slacmdregistry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.