im using uptimerobot.com to create my first discord bot, but it does not work well. i really dont have no idea to solve this problem. the following picture shows how i use uptimerobot.com
according to the logs, i got errors 5~6 hours ago (above the line)
however, i did not receive any errors 1~4 hours ago. (note that i did not change anything)
This error usually happens when your Discord bot token is invalid. Can you try generating a new Discord token and using it?
although i regenerate my token and paste it env, it could not work wellâŚ
plus, no error is in logs
Hey @33333-33333,
Can you provide the project name so that I can take a look? And it would be better to move all your tokens, even commented ones to the .env
file.
url deleted
here is the link of it
EhhhâŚthe project is set to private! Maybe you can make it public for a whileâŚ
sry i made it public
Hey @33333-33333,
The error was caused because a Discord bot token was not provided. And the token was not provide because you referred it in the .env
in a wrong way. To fix the issue, in line 1 of your main.js
, change the statement to:
const TOKEN = process.env.DISCORD_BOT_TOKEN;
because you declared the Discord token as DISCORD_BOT_TOKEN
, not simply TOKEN
in the .env
file.
And make sure you have the following statement at the bottom of your main.js
:
client.login(TOKEN);
That should fix the issue
Happy Glitching!
When I remixed your project, it never stopped loading. The circle will keep on moving next to the Tools button. There might be something wrong with the code.
could you tell me where it is wrong?
for the infinite loading part, add this to the top of bot.js or index.js or wherever the main part of your bot is:
const http = require(âhttpâ);
const express = require(âexpressâ);
const app = express();
app.use(express.static(âpublicâ));
app.get(â/â, (request, response) => {
console.log(Date.now() + " ping received!");
response.sendStatus(200);
// The file âindex.htmlâ is being sent to the server, which will be rendered once someone has visited the route/
response.sendFile(__dirname + â/public/â);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(http://[PROJECT NAME HERE].glitch.me/
);
}, 280000);
let me know if that works for the infinitely loading circle part.
What is your discord tag, could you add me, and dm me your project invite link so i could take a look at your errors, and possibly help you?
i know the errors, you gotta replace the pasted '
with a normal â
ohh. right. I didnât catch that when i looked at the screenshot above
const http = require("http");
const express = require("express");
const app = express();
app.use(express.static("public"));
app.get("/", (request, response) => {
console.log(Date.now() + " ping received!");
response.sendStatus(200);
// The file âindex.htmlâ is being sent to the server, which will be rendered once someone has visited the route "/"
response.sendFile(__dirname + "/public/");
});
app.listen(process.env.PORT);
setInterval(() => {
http.get("http://[PROJECT NAME HERE].glitch.me/" );
}, 280000);