Getting Hosting Errors -- Discord Bot

So my bot works but i keep getting some error that makes my bot do almost nothing only the help command. Here is the error codes :slight_smile:

Bot is ready!

(node:487) UnhandledPromiseRejectionWarning: TypeError: bot.guilds.array is not a function

Jump Toat Object.Events.onInitialization (/app/bot.js:977:30)

Jump Toat Object.Bot.preformInitialization (/app/bot.js:138:10)

Jump Toat Object.Bot.onReady (/app/bot.js:127:7)

at Client.emit (events.js:189:13)

at WebSocketManager.triggerClientReady (/rbd/pnpm-volume/37598354-32f8-4717-ac3d-be6163595ffe/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/websocket/WebSocketManager.js:431:17)

at WebSocketManager.checkShardsReady (/rbd/pnpm-volume/37598354-32f8-4717-ac3d-be6163595ffe/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/websocket/WebSocketManager.js:415:10)

at WebSocketShard.shard.on.unavailableGuilds (/rbd/pnpm-volume/37598354-32f8-4717-ac3d-be6163595ffe/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/websocket/WebSocketManager.js:197:14)

at WebSocketShard.emit (events.js:189:13)

at WebSocketShard.checkReady (/rbd/pnpm-volume/37598354-32f8-4717-ac3d-be6163595ffe/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/websocket/WebSocketShard.js:475:12)

at WebSocketShard.onPacket (/rbd/pnpm-volume/37598354-32f8-4717-ac3d-be6163595ffe/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/websocket/WebSocketShard.js:447:16)

(node:487) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:487) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

You are using a version of discord.js that is not compatible withyour bot.

1 Like

Can i update it?

you mean downgrade?

if it makes the bot work correct then yes

Yes, you can change the version in your package.json file.

{
“name”: “discord-bot-maker-bot”,
“version”: “1.0.0”,
“description”: “You don’t have this”,
“main”: “bot.js”,
“scripts”: {
“start”: “node bot.js”
},
“dependencies”: {
“discord.js”: “12.3.1”,
“express”: “^4.17.1”,
“fstorm”: “latest”,
“jimp”: “latest”,
“node-cron”: “^2.0.3”,
“request”: “^2.88.2”
},
“license”: “ISC”
}

Sorry but what to change it to and where

{
“name”: “discord-bot-maker-bot”,
“version”: “1.0.0”,
“description”: “You don’t have this”,
“main”: “bot.js”,
“scripts”: {
“start”: “node bot.js”
},
“dependencies”: {
“discord.js”: “^11.6.4”,
“express”: “^4.17.1”,
“fstorm”: “latest”,
“jimp”: “latest”,
“node-cron”: “^2.0.3”,
“request”: “^2.88.2”
},
“license”: “ISC”
}

When i switch to the ^11.6.4 i get this error

Check /app/package.json: it has syntax errors, install won’t proceed.

11:54 AM

a few seconds ago

parse error: Invalid numeric literal at line 10, column 32

You should use ",not or .

2 Likes

Then i get this.
TypeError: Cannot read property ‘extend’ of undefined

1:34 PM

Jump Toat Object.mod (/app/actions/delete_member_data_MOD.js:53:30)

1:34 PM

Jump Toat Object. (/app/bot.js:346:13)

1:34 PM

at Array.forEach ()

1:34 PM

Jump Toat Object.Actions.initMods (/app/bot.js:340:32)

1:34 PM

Jump Toat Object.Files.startBot (/app/bot.js:1125:11)

1:34 PM

Jump Toat Object. (/app/bot.js:1695:7)

1:34 PM

at Module._compile (internal/modules/cjs/loader.js:701:30)

1:34 PM

at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10)

1:34 PM

at Module.load (internal/modules/cjs/loader.js:600:32)

1:34 PM

at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

1:34 PM

TypeError: Cannot read property ‘extend’ of undefined

1:34 PM

Jump Toat Object.mod (/app/actions/delete_server_data_MOD.js:57:30)

1:34 PM

Jump Toat Object. (/app/bot.js:346:13)

1:34 PM

at Array.forEach ()

1:34 PM

Jump Toat Object.Actions.initMods (/app/bot.js:340:32)

1:34 PM

Jump Toat Object.Files.startBot (/app/bot.js:1125:11)

1:34 PM

Jump Toat Object. (/app/bot.js:1695:7)

1:34 PM

at Module._compile (internal/modules/cjs/loader.js:701:30)

1:34 PM

at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10)

1:34 PM

at Module.load (internal/modules/cjs/loader.js:600:32)

1:34 PM

at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

1:34 PM

Bot is ready!

Try adding

  "engines": {
    "node": "12.x"
  },