Hosting Not Working

I can’t host my bot on glitch i keep getting this error.

Check /app/package.json: it has syntax errors, install won’t proceed.
parse error: Expected separator between values at line 12, column 29.

Here is my code if anybody want to help.

{
“name”: “discord-bot-maker-bot”,
“author”: “Robert Borghese”,
“main”: “bot.js”,
“version”: “1.6.9”,
“dependencies”: {
“discord.js”: “^12.2.0”,
“fstorm”: “latest”,
“jimp”: “latest”,
“node-cron”: “^2.0.3”,
“request”: “^2.88.2”
“express-glitch-keepalive”: “^0.2.0”,
“express”: “^4.16.4”
}
“scripts”: {
“start”: “node bot.js”
},
}

Add a comma to the end of this line.

1 Like

Also, remove the comma from the 2nd to last line.

Check out https://beautifier.io - it can help you find missing commas and such.


Like what @RiversideRocks said - there’s no comma after request, so the line breaks are funny.

Also I didn’t know “latest” is a valid version number :thinking:

2 Likes

Thats a simple fix to do. I fixed up for you;

“name”: “discord-bot-maker-bot”,
“author”: “Robert Borghese”,
“main”: “bot.js”,
“version”: “1.6.9”,
“dependencies”: {
“discord.js”: “^12.2.0”,
“fstorm”: “latest”,
“jimp”: “latest”,
“node-cron”: “^2.0.3”,
“request”: “^2.88.2”,
“express-glitch-keepalive”: “^0.2.0”,
“express”: “^4.16.4”
}
“scripts”: {
“start”: “node bot.js”
},
}

This was already solved

2 Likes

Hello SplitXPlay When i put in you’re code i get this error message
parse error: Invalid numeric literal at line 1, column 11

You code was correct, don’t use their code. All you had to do was add a comma after request.

2 Likes

{
“name”: “discord-bot-maker-bot”,
“author”: “Robert Borghese”,
“main”: “bot.js”,
“version”: “1.6.9”,
“dependencies”: {
“discord.js”: “^12.2.0”,
“fstorm”: “latest”,
“jimp”: “latest”,
“node-cron”: “^2.0.3”,
“request”: “^2.88.2”,
“express-glitch-keepalive”: “^0.2.0”,
“express”: “^4.16.4”
}
“scripts”: {
“start”: “node bot.js”
},
}

This is the new code but i get this error

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

parse error: Invalid numeric literal at line 2, column 11

{
“name”: “discord-bot-maker-bot”,
“author”: “Robert Borghese”,
“main”: “bot.js”,
“version”: “1.6.9”,
“dependencies”: {
“discord.js”: “^12.2.0”,
“fstorm”: “latest”,
“jimp”: “latest”,
“node-cron”: “^2.0.3”,
“request”: “^2.88.2”,
“express-glitch-keepalive”: “^0.2.0”,
“express”: “^4.16.4”
},
“scripts”: {
“start”: “node bot.js”
},
}

1 Like

lol, another missing comma

I Still get this error

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

parse error: Invalid numeric literal at line 2, column 11

Could you please share your current package.json file?

1 Like

Yeah sure.
Can’t send it cuz it is an json file so here’s da code.

{
“name”: “discord-bot-maker-bot”,
“author”: “Robert Borghese”,
“main”: “bot.js”,
“version”: “1.6.9”,
“dependencies”: {
“discord.js”: “^12.2.0”,
“fstorm”: “latest”,
“jimp”: “latest”,
“node-cron”: “^2.0.3”,
“request”: “^2.88.2”,
“express-glitch-keepalive”: “^0.2.0”,
“express”: “^4.16.4”,
},
“scripts”: {
“start”: “node bot.js”
},
}

{
“name”: “discord-bot-maker-bot”,
“author”: “Robert Borghese”,
“main”: “bot.js”,
“version”: “1.6.9”,
“dependencies”: {
“discord.js”: “^12.2.0”,
“fstorm”: “latest”,
“jimp”: “latest”,
“node-cron”: “^2.0.3”,
“request”: “^2.88.2”,
“express-glitch-keepalive”: “^0.2.0”,
“express”: “^4.16.4”,
},
“scripts”: {
“start”: “node bot.js”
}
}

hold on. Ima get one from the project.

Also, just a heads up that you should remove this package (npm remove express-glitch-keepalive) as you will probably get your project banned if you keep this here.

2 Likes

It will only be banned by the use of it. I have it in a project that I forgot it was in there and it didn’t get banned. Also, Glitch blocks those requests.

Still get

parse error: Invalid numeric literal at line 2, column 11

Try making a new node project, then add the packages and coping it.

Still dosen’t work :frowning:

Can you please give us a share link?

They have already shared the package.json file contents. You can use that. :stuck_out_tongue:

LOL.

1 Like

what?
(10char)

Check now.

there still could’ve been a problem outside :confused:

Probably not because the error message stated that the error was in the package.json file.

3 Likes

Yeah says package error. Really dunno what to do :frowning: so sad.

Ima run it through VS Code.

Screen Shot 2020-08-30 at 3.24.05 PM
Fix coming up.

Maybe its because of all the spaces?

Yeah, I got it though.

{
    "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.2.0",
      "express": "^4.17.1",
      "fstorm": "latest",
      "jimp": "latest",
      "node-cron": "^2.0.3"
    },
    "license": "ISC",
  }
2 Likes

That looks a lot better. That should probably work.

1 Like

Hello Now i get this error.
Check /app/package.json: it has syntax errors, install won’t proceed.
parse error: Expected another key-value pair at line 17, column 3

Remove that comma

2 Likes

Shouldn’t latest be changed to *

1 Like

Didn’t work

Hello guys quick update got the thing working by using thise code.
{
“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.2.0”,
“express”: “^4.17.1”,
“fstorm”: “latest”,
“jimp”: “latest”,
“node-cron”: “^2.0.3”
},
“license”: “ISC”
}

But now i get this stuff.

internal/modules/cjs/loader.js:584

throw err;
^
Error: Cannot find module ‘express-glitch-keepalive’

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)

at Function.Module._load (internal/modules/cjs/loader.js:508:25)

at Module.require (internal/modules/cjs/loader.js:637:17)

at require (internal/modules/cjs/helpers.js:22:18)

Jump Toat Object. (/app/bot.js:16:19)

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

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

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

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

at Function.Module._load (internal/modules/cjs/loader.js:531:3)

I fell dumb for asking but i got no idea wtf to do. when i press jump to this is what i see.

const keepalive = require(‘express-glitch-keepalive’);

I removed that as it was pointless, it will not keep your project up anymore.

1 Like

You just needs to remove the package express-glitch-keepalive from your package.json file.

Don’t you mean remove the line of code that’s trying to use it? It’s not actually in the package.json, it’s in the main file - just delete the line that the error takes you to.

3 Likes

When i remove the link i get this.
at Object. (/app/bot.js:19:9)
then i go to it and it is this. (after i removed it still dosen’t work)
app.use(keepalive);
Then the red dot says keepalive is not defined.

Hi
Can you remove the line:

app.use(keepalive)

Yeah sure i can do that

1 Like

Now i get this
(node:7608) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.

2:00 PM

at WebSocketManager.connect (/rbd/pnpm-volume/37598354-32f8-4717-ac3d-be6163595ffe/node_modules/.registry.npmjs.org/discord.js/12.2.0/node_modules/discord.js/src/client/websocket/WebSocketManager.js:135:26)

2:00 PM

at Client.login (/rbd/pnpm-volume/37598354-32f8-4717-ac3d-be6163595ffe/node_modules/.registry.npmjs.org/discord.js/12.2.0/node_modules/discord.js/src/client/Client.js:221:21)

2:00 PM

(node:7608) 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)

2:00 PM

(node:7608) [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.

Hi. When you login to the bot, using

bot.login(whatever)

Can you make sure you entered the token in quotes or used the env file to enter the token, where I put whatever?

Now i get this.
Bot is ready!

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

2:10 PM

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

2:10 PM

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

2:10 PM

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

2:10 PM

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

2:10 PM

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

2:10 PM

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

2:10 PM

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

2:10 PM

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

2:10 PM

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

2:10 PM

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

2:10 PM

(node:7858) 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)

2:10 PM

(node:7858) [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.
[ ‘https://cdn.nekos.life/Random_hentai_gif/Random_hentai_gifNB_0302.gif’ ]

2:12 PM

WebAPI: JSON Data values starting from [url] stored to: [image]

2:12 PM

Error with Event “Create Embed Message”, Action #2:

2:12 PM

TypeError: this.channels.get is not a function

Can you replace that with
bot.guilds.cache
Can I also see the code that uses bot.guilds.array?

Can you on discord so it’s easier for me?

I’d rather do it here

1 Like

Alright i replaced it

Now i get this.

(node:7992) UnhandledPromiseRejectionWarning: TypeError: bot.guilds.cache is not a function

2:31 PM

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

2:31 PM

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

2:31 PM

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

2:31 PM

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

2:31 PM

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

2:31 PM

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

2:31 PM

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

2:31 PM

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

2:31 PM

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

2:31 PM

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

2:31 PM

(node:7992) 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)

2:31 PM

(node:7992) [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.

Can I see the code that uses it?

/*

  • Discord Bot Maker Bot
  • Version 2.0.1
  • Robert Borghese
    */

const DBM = {};
const DiscordJS = DBM.DiscordJS = require(‘discord.js’);

//---------------------------------------------------------------------
// Glitch 24/7
// Required to let uptime robot waving our bot.
//---------------------------------------------------------------------

const express = require(‘express’);

const app = express();

app.get(’/’, (req, res) => {
res.json(‘This bot should be online! Uptimerobot will keep it alive’);
});
app.get("/", (request, response) => {
response.sendStatus(200);
});
app.listen(process.env.PORT);

//---------------------------------------------------------------------
// Bot
// Contains functions for controlling the bot.
//---------------------------------------------------------------------

const Bot = DBM.Bot = {};

Bot.$cmds = {}; // Normal commands
Bot.$icds = ; // Includes word commands
Bot.$regx = ; // Regular Expression commands
Bot.$anym = ; // Any message commands
Bot.$evts = {}; // Events

Bot.bot = null;

Bot.init = function() {