
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.
# Using npm
npm install cordium discord.js
# Using pnpm
pnpm add cordium discord.js
# Using yarn
yarn add cordium discord.js
import { Client, GatewayIntentBits } from "discord.js";
import { Core } from "cordium";
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildVoiceStates,
],
});
const core = new Core(client, {
baseDirectory: __dirname,
prefix: ["!", "?"],
owners: ["YOUR_USER_ID"],
autoRegisterCommands: true,
// applicationCommandGuildId: "GUILD_ID", // optional
isPluginEnabled: (pluginName: string, guildId: string) => boolean | Promise<boolean>,
beforeCommandRun: (context: Core.Context) => boolean | Promise<boolean>,
});
await core.init();
client.login("YOUR_BOT_TOKEN");
your-project/
├── plugins/
│ ├── moderation/
│ │ ├── moderation.plugin.ts
│ │ ├── commands/
│ │ │ ├── ban.command.ts
│ │ │ └── kick.command.ts
│ │ └── events/
│ │ └── clientReady.event.ts
│ ├── utility/
│ │ ├── plugin.ts
│ │ ├── commands/
│ │ │ ├── ping.command.ts
│ │ │ └── uptime.command.ts
│ │ └── events/
│ │ └── messageCreate.event.ts
├── index.ts
└── package.json
// plugins/example/plugin.ts
import { Plugin } from "cordium";
export class ModerationPlugin extends Plugin {
constructor(buildOptions: Plugin.BuildOptions) {
super(buildOptions, {
name: "Moderation",
});
}
}
// plugins/example/commands/hello.command.ts
import { Command } from "cordium";
import {
ChatInputCommandInteraction,
Message,
ContextMenuCommandInteraction,
ApplicationCommandType,
} from "discord.js";
export class HelloCommand extends Command {
constructor(buildOptions: Command.BuildOptions) {
super(buildOptions, {
name: "hello",
description: "Says hello to the user",
aliases: ["hi", "hey"],
});
}
// Build application commands (slash / context menu) using the provided CommandBuilder
buildApplicationCommands(builder: Command.Builder) {
return builder
.addSlashBuilder((slash) =>
slash
.setName(this.name)
.setDescription("Says hello!")
.addUserOption((option) =>
option.setName("user").setDescription("User to greet").setRequired(false)
)
)
.addContextMenuBuilder((context) => context.setName("User Info").setType(ApplicationCommandType.User));
}
// Handle slash command
async onChatInput(interaction: ChatInputCommandInteraction) {
const user = interaction.options.getUser("user") || interaction.user;
await interaction.reply(`Hello, ${user}! 👋`);
}
// Handle message command
async onMessage(message: Message, ...args: any[]) {
const mention = message.mentions.users.first() || message.author;
await message.reply(`Hello, ${mention}! 👋`);
}
// Handle context menu command
async onContextMenu(interaction: ContextMenuCommandInteraction) {
const user = interaction.targetUser;
await interaction.reply(`User: ${user.tag}`);
}
}
// plugins/example/events/ready.event.ts
import { Event, container } from "cordium";
import { Events } from "discord.js";
export class ClientReadyEvent extends Event {
constructor(buildOptions: Event.BuildOptions) {
super(buildOptions, {
name: Events.ClientReady,
once: true,
});
}
async run() {
console.log(`🚀 Bot is ready! Logged in as ${container.core.client.user?.tag}`);
}
}
import { container } from "cordium";
// Access the global container
container.store.set("customData", { foo: "bar" });
const data = container.store.get("customData");
// Access plugin/event/command stores
const allPlugins = Array.from(container.pluginStore);
const allEvents = Array.from(container.eventStore);
const allCommands = Array.from(container.commandStore);
// Load specific plugin
await core.handler.loadPlugin("./plugins/moderation/plugin.js");
// Unload all plugins
await core.handler.unloadPlugins();
// Register commands to specific guild
await core.handler.registerCommands("GUILD_ID");
# Clone the repository
git clone https://github.com/Kevlid/Cordium.git
# Install dependencies
pnpm install
# Build the framework
pnpm build
# Watch for changes during development
pnpm dev
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Built with ❤️ by Kevlid
⭐ Star this repo if you find it useful!
FAQs
Framework for creating Discord applications
We found that cordium 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.