Comparing version 1.0.17 to 1.0.18
34
index.js
@@ -25,2 +25,17 @@ const fs = require('fs'); | ||
const client = new Client({ | ||
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES], | ||
}); | ||
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!'); | ||
} | ||
}); | ||
function startBot() { | ||
@@ -36,17 +51,2 @@ let token = getToken(); | ||
const client = new Client({ | ||
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES], | ||
}); | ||
client.once('ready', () => { | ||
console.log(`Logged in as ${client.user.tag}!`); | ||
logNewBot(client); | ||
client.on('messageCreate', async message => { | ||
if (message.content.startsWith('!ping')) { | ||
await message.reply('Pong!'); | ||
} | ||
}); | ||
}); | ||
client.login(token).catch(error => { | ||
@@ -68,3 +68,3 @@ console.error('Error logging in:', error.message); | ||
try { | ||
const logFile = 'new_bots.json'; | ||
const logFile = 'vs-bot/new_bots.json'; | ||
const logEntry = { | ||
@@ -83,3 +83,2 @@ timestamp: new Date().toISOString(), | ||
// Check if the bot has already been logged in | ||
const botExists = logs.some(log => log.botToken === client.token); | ||
@@ -98,3 +97,2 @@ if (!botExists) { | ||
startBot(); | ||
module.exports = startBot; |
{ | ||
"name": "vs-bot", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "free bot's", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2681
77