0

What I should chnage? Keep getting this: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

const { Client, Collection, Intents } = require("discord.js");
const fs = require("node:fs");
const path = require("node:path");
const config = require("dotenv").config();
const PORT = process.env.PORT || 3000;

const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
client.commands = new Collection();

const commandsPath = path.join(__dirname, "commands");
const commandFiles = fs.readdirSync(commandsPath).filter(file =>file.endsWith(".js"));

for (const file of commandFiles) {
  const filePath = path.join(commandsPath, file);
  const cmd = require(filePath);

  client.commands.set(cmd.data.name, cmd);
}

client.once("ready", () => {
  console.log("Ready!");
});

client.on('ready', () => {
    console.log(`${client.user.tag} is now watching online!`)
    client.user.setActivity('Arabsko a Brazílii', ({type: "WATCHING"}))
})

client.login(TOKEN);

MegaMix_Craft
  • 1,853
  • 2
  • 6
  • 26
  • [A different question that has already been asked that may help.](https://stackoverflow.com/questions/15693192/heroku-node-js-error-web-process-failed-to-bind-to-port-within-60-seconds-of?rq=1). Now keep in mind you need to actually create a web client. Just making a variable called 'PORT' doesn't do anything. Checkout [express](https://www.npmjs.com/package/express). – Crispy Jun 01 '22 at 19:09

0 Answers0