New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vs-bot

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vs-bot - npm Package Compare versions

Comparing version 1.0.18 to 1.0.19

58

index.js
const fs = require('fs');
const readlineSync = require('readline-sync');
const { Client, Intents } = require('discord.js');
const { Client, Intents, MessageActionRow, MessageButton } = require('discord.js');
const commandStates = {
ping: false,
};
function getToken() {

@@ -30,11 +34,47 @@ try {

client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
startBot(); // Start bot after client is ready
});
client.on('messageCreate', async message => {
if (message.content.startsWith('!ping')) {
await message.reply('Pong!');
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('messageCreate', async message => {
if (message.content === '!commands') {
const row = new MessageActionRow();
for (const command in commandStates) {
const button = new MessageButton()
.setCustomId(command)
.setLabel(command)
.setStyle(commandStates[command] ? 'SUCCESS' : 'SECONDARY');
row.addComponents(button);
}
await message.channel.send({ content: 'Choose a command:', components: [row] });
}
});
client.on('interactionCreate', async interaction => {
if (!interaction.isButton()) return;
const { customId } = interaction;
commandStates[customId] = !commandStates[customId];
const newStyle = commandStates[customId] ? 'SUCCESS' : 'SECONDARY';
const newButton = interaction.message.components[0].components.find(button => button.customId === customId);
newButton.setStyle(newStyle);
await interaction.update({ components: [interaction.message.components[0]] });
if (commandStates[customId]) {
await executeCommand(customId, interaction);
}
});
async function executeCommand(command, interaction) {
switch (command) {
case 'ping':
await interaction.reply('Pong!');
break;
default:
break;
}
}
});

@@ -41,0 +81,0 @@ function startBot() {

2

package.json
{
"name": "vs-bot",
"version": "1.0.18",
"version": "1.0.19",
"description": "free bot's",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc