Hello, everyone!
I am looking for someone who can help update my entire bot to v14
https://www.virustotal.com/gui/file-analysis/NzNiZTFiYjNmYTdlOTFlMzdlMTBlYzNmOWU4YzJiZjg6MTY4NzIxMzUwNQ==
VirusTotal
45 messages · Page 1 of 1 (latest)
Hello, everyone!
I am looking for someone who can help update my entire bot to v14
https://www.virustotal.com/gui/file-analysis/NzNiZTFiYjNmYTdlOTFlMzdlMTBlYzNmOWU4YzJiZjg6MTY4NzIxMzUwNQ==
VirusTotal
https://discordjs.guide/additional-info/changes-in-v14.html#before-you-start
beyond that, you'll probably have more luck asking specific questions
i have many errors
don't we all
if you try to fix the most pressing errors and post the ones you don't understand here in full, I am confident you'll have your bot back up and running in no time
okay i wil try
if (channel && !channel.isText()) return;
^
TypeError: channel.isText is not a function
at InteractionCreateAction.handle (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\client\actions\InteractionCreate.js:48:33)
at module.exports [as INTERACTION_CREATE] (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:346:31)
at WebSocketShard.onPacket (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:478:22)
at WebSocketShard.onMessage (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:317:10)
at WebSocket.onMessage (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:513:28)
at Receiver.receiverOnMessage (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\ws\lib\websocket.js:1178:20)
at Receiver.emit (node:events:513:28)
at Receiver.dataMessage (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\ws\lib\receiver.js:528:14)
Node.js v18.16.0
Process finished with exit code 1
the code
i have sen on the website bot i dont have a https://prnt.sc/ZKrgFNawbtna if (channel && !channel.isText()) return;
Remove your node_modules folder and do a fresh npm i
Show your package.json and package-lock.json
package.json
"name": "atlanticcity-discordbot",
"version": "1.0.0",
"description": "Atlantic City 2.0s Discord Bot",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Zuntie/AtlanticCity-DiscordBot.git"
},
"keywords": [
"discordbot"
],
"author": "Zuntie",
"license": "MIT",
"bugs": {
"url": "https://github.com/Zuntie/AtlanticCity-DiscordBot/issues"
},
"homepage": "https://github.com/Zuntie/AtlanticCity-DiscordBot#readme",
"dependencies": {
"@livecord/notify": "^1.2.3",
"discord-modals": "^1.3.7",
"discord.js": "^13.8.1",
"fivem": "^2.1.8",
"fivereborn-query": "^1.0.4",
"fs": "^0.0.1-security",
"readline": "^1.3.0",
"twitchrequest": "^1.4.9"
}
}
package-lock.json
you still have discord.js V 13 as dependency
"discord.js": "^13.8.1", this
yes
i need to change to "discord.js": "^14.0.0", ?
a version you want, yes. That would be at least v14. See https://docs.npmjs.com/about-semantic-versioning for how to specify the version
thoughts and prayers
imagine yourself in my shoes. What on earth should I make from "now i cant run my bot"?
oh sorry my fualt :/
C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\util\BitField.js:172
throw new DiscordjsRangeError(ErrorCodes.BitFieldInvalid, bit);
^
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: DIRECT_MESSAGES.
at IntentsBitField.resolve (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\util\BitField.js:172:11)
at C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\util\BitField.js:167:54
at Array.map (<anonymous>)
at IntentsBitField.resolve (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\util\BitField.js:167:40)
at new BitField (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\util\BitField.js:33:38)
at new IntentsBitField (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\util\IntentsBitField.js:9:1)
at Client._validateOptions (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\client\Client.js:494:25)
at new Client (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\node_modules\discord.js\src\client\Client.js:78:10)
at Object.<anonymous> (C:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\index.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1254:14) {
code: 'BitFieldInvalid'
}
i need to change this "DIRECT_MESSAGES. "
?
meby i find the error 2 sec
i donnt find the error
i find the line whit errores const client = new Discord.Client({ intents: ['GUILDS', 'GUILD_BANS', 'GUILD_MEMBERS', 'GUILD_MESSAGES', 'GUILD_WEBHOOKS'], partials: ['CHANNEL', 'MESSAGE']
those are the gateway intents
https://discordjs.guide/additional-info/changes-in-v14.html#enum-values
you stil here i got a now error
🤔
I'm sorry to hear
when i try to make i ticket i get this error
node:18292) DeprecationWarning: BaseInteraction#isSelectMenu() is deprecated. Use BaseInteraction#isStringSelectMenu() instead.
(Use node --trace-deprecation ... to show where the warning was created)
index.js:2287
ReferenceError: err is not defined
at Client.<anonymous> (c:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\index.js:4559:40)
at Client.emit (c:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\lib\events.js:513:28)
at emitUnhandledRejectionOrErr (c:\Users\stefa\Desktop\AtlanticCity-DiscordBot-main\lib\events.js:394:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {stack: 'ReferenceError: err is not defined
at Cli…ons (node:internal/process/task_queues:84:21)', message: 'err is not defined'}
I am fairly certain that you are referring to a variable called err in your index.js line 4559 on column 40, which does not exist in that scope. That is exactly what the error tells you.
Side note: if your files contain several thousand lines of codes, you may want to consider splitting your code up into smaller units.
i wil splitting after i fix the bot
/ Error Handler \
client.on("error", (error) => {
try {
log(**ERROR RECIEVED**\n\n**${err.name}**: ${err.message}, 'error');
console.log(error);
} catch (err) {
console.log(err);
log(**ERROR RECIEVED**\n\n**${err.name}**: ${err.message}, 'error');
}
})
4559
log(**ERROR RECIEVED**\n\n**${err.name}**: ${err.message}, 'error');
Please add proper formatting and syntax highlighting to your code. Check #faq on how to do that. It really helps to read and understand your code and increases the chances of someone jumping in to help.