Error

so I have been trying to create a discord bot using discord.js. Upon creating the bot, i realised there were some errors. after checking what errors they were i found mootools and it said that there was no fix to it. If i cannot fix it how can i run my code?
21 Replies
d.js toolkit
d.js toolkit7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Hacker249
Hacker249OP7mo ago
i have updated my node to the latest version (v20 i think it is)
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Hacker249
Hacker249OP7mo ago
ok
Hacker249
Hacker249OP7mo ago
npm audit report mootools * Severity: high Prototype Pollution in mootools - https://github.com/advisories/GHSA-x6hx-7gh3-3q98 MooTools Regular Expression Denial of Service - https://github.com/advisories/GHSA-v63q-hgqc-qvpg No fix available node_modules/mootools discord * Depends on vulnerable versions of mootools node_modules/discord 2 vulnerabilities (1 moderate, 1 high) Some issues need review, and may require choosing a different dependency. ~/botjs$ npm list -g /home/runner/botjs/.config/npm/node_global/lib └── (empty)
GitHub
CVE-2021-23432 - GitHub Advisory Database
Prototype Pollution in mootools
GitHub
CVE-2021-32821 - GitHub Advisory Database
MooTools Regular Expression Denial of Service
Hacker249
Hacker249OP7mo ago
and theres another 1 but this problem needs to be fixed in order to solve that one ill paste TypeError: Cannot read properties of undefined (reading 'FLAGS') at Object.<anonymous> (/home/runner/botjs/index.js:5:17) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at node:internal/main/run_main_module:28:49
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Hacker249
Hacker249OP7mo ago
i tried uninstalling mootools but never worked sadly
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Hacker249
Hacker249OP7mo ago
{ "name": "nodejs", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo "Error: no test specified" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "@types/node": "^18.0.6", "discord": "^0.8.2", "discord.js": "^14.15.2", "index.js": "^0.0.3", "node": "^22.1.0" } }
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Hacker249
Hacker249OP7mo ago
oh k i uninstalled and now it's saying 0 vulnerabilities so it was that discord thing that was causing this issue?
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Hacker249
Hacker249OP7mo ago
oh so it's outdated? im not gonna lie im kinda new to js lol
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Hacker249
Hacker249OP7mo ago
ok const { Client, Intents } = require('discord.js'); const client = new Client({ intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ] }); const prefix = 'e!'; client.once('ready', () => { console.log('Bot is ready'); }); client.on('messageCreate', message => { if (!message.content.startsWith(prefix) || message.author.bot) return; const args = message.content.slice(prefix.length).trim().split(/ +/); const command = args.shift().toLowerCase(); if (command === 'ping') { message.reply('pong'); } }); client.login('my token. (Can't give for security reasons'); i use replit for running my code
d.js docs
d.js docs7mo ago
:guide: Home: Introduction read more
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Hacker249
Hacker249OP7mo ago
ok
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Hacker249
Hacker249OP7mo ago
oh k ty for pointing that out
Want results from more Discord servers?
Add your server