Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.