
Product
Rubygems Ecosystem Support Now Generally Available
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
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
The npm package cmder.js receives a total of 1 weekly downloads. As such, cmder.js popularity was classified as not popular.
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.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.