Hi Developers, so I create a class called onShout. It fires when a group shout is fired from ROBLOX group. The code works fine, but after a certain amount of time, it gives and error socket hang up. How do I fix this problems?
CODE:
const rbx = require('noblox.js');
module.exports = class OnShout {
constructor(bot,config) {
let onShout = rbx.onShout(Number(config.group));
onShout.on('data', function(post) {
if (post.body && post.body.length !== 0) {
bot.guilds.cache.get(config.guild).channels.cache.get(config.channel).send(post.body)
}
});
}
}
It means that after 5 minutes Glitch projects shut off, therefore closing your connection. If you’re trying to run a bot, move to repl with uptimerobot. Ideally we need Glitch’s smooth editor on Repl’s hosting.
it seems to be a discord.js error. I had this error before. I solved it by just restarting the project. You can also, remix the project and see if that stops it.
And if you have Comcast. You may need admin.They release a new feature in early 2020 where they would block request going to your devices. It blocked Glitch’s CDN for some reason, but when I disabled it, it fixed everything.