I'm trying to make a discord bot that runs 24/7 using Heroku. Everything is good, except for the fact that the bot crashes after 60 seconds.
The error output tells me this:
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
I looked for solutions on the internet, and I found quite a few. However, none of them worked.
Here's my main file's code:
const Discord = require('discord.js')
const {prefix, token} = require('./config.json')
const client = new Discord.Client()
// Login
client.login(token)
client.once('ready', () => {
console.log('Back online')
client.user.setActivity(' channel', {type: 'LISTENING'})
})
client.on('message', message => {
if (message.author.bot) {
return;
}
if (message.content.toLowerCase() === 'hello') {
message.channel.send('Hey!')
}
})