
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
A node.js module to handle Discord.js commands and events.
Run one of the following commands based on your package manager:
npm install cmder.js
pnpm add cmder.js
yarn add cmder.js
Install the package, then create a new file in your root directory called 'cmder.yaml'. This will be our configuration file. It will look something like this:
paths:
events: ./src/events
commands: ./src/commands
Now, our src/index.js file:
const { Client } = require("discord.js");
const { Handler } = require("cmder.js");
const client = new Client({
/* client config */
});
new Handler(client); // initialize the Handler class
client.login(TOKEN); // replace TOKEN with your bot's token
project
βββ cmder.yaml
βββ package.json
βββ src/
βββ index.js
βββ commands/
β βββ General/
β β βββ ping.js
β βββ Misc/
β βββ info.js
βββ events/
β βββ Client/
β β βββ ready.js
β βββ Messages/
β βββ messageCreate.js
What matters is what the event exports, which should look like this:
src/events/Client/ready.js
module.exports = {
name: "ready" // This will be the name of our event (from client.on).
once: true, // Optional. This will determine whether the event runs only once.
run: (c) => { // The parameters are the same of doing client.on.
console.log(`${c.user.tag} is now online!`);
}
};
Commands are similar to eventsβneither the folder name nor the file name matter, but the exports do:
src/commands/General/ping.js
module.exports = {
data: {
// The command's information.
// You can use builders if you'd like.
name: "ping",
description: "Replies with Pong!",
},
run: ({ interaction, client, handler }) => {
interaction.reply("Pong!!!");
},
};
FAQs
Unknown package
We found that cmder.js demonstrated a not healthy version release cadence and project activity because the last version was released 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezerβs API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.