One Project to Wake Them All

Hi! I’ve recently got into the hobby of making little Twitch chatbots / discord bots for some friends (not for large scale distribution), so was disappointed to find that asleep projects take a while to wake up and respond, and I have only a maximum of 5 that can be online at all times.

I was initially looking at ways to host my own nodejs things elsewhere, but as I’m still quite new to all this, I absolutely cannot handle all the complexity that comes with setting up hosting and FTP and SSH and all these other things I only have a very base understanding of, and honestly? I love glitch, I don’t want to leave this environment if I don’t have to. But I just had an idea to potentially solve that issue-

===TL;DR===

As these chatbots don’t need to be awake unless the relevant channels are live- can I therefore have one always-awake project which checks if any of the streamers using my chatbots are live, and then have it ping the relevant chatbot project every 4 minutes to keep it awake for the duration of the livestream?

A) Would that work well enough, and without issue?
B) Is this considered to be “gaming” Glitch’s limits or something, or is this how the system is intended to be used?

Probably not. Glitch blocks pings. I’d recommend upgrading to pro/boosted apps and boosting the apps that are chatbots.

I have upgraded and boosted, but this limits me to 5 chatbots, and I’d like to be able to develop and run more- and it seems like a waste of processing if it’s running for 24 hours a day and only being used for perhaps 7 of them :frowning:

My idea would be to look into reverse engineering Glitch’s API to rotate the boosted apps based on when a channel is live.

If you need help with this, I would be happy to look into it!

Hmm, I’m unsure if this would be the best solution for me as I’ll likely run into scenarios where I need more than 5 running at once, but I will definitely add it to my mental list of potential solutions! And thank you so much for the offer!

1 Like

Am I looking at this the wrong way? Should I be using ONE app with “Server.js” handling the connections of my individual chatbots, and make an app.js type thing within that same project for each chatbot?

I’ve gone down this route in the discord case.

Slight difference: in order to justify that it’s not ‘pinging’ the bot while there’s activity, instead messages flow through the always-online part. The always-on component serves more like a relay than what one would describe as “an automated way to wake projects up and keep them from sleeping,” albeit not 24/7.

But the downside is that it’s vastly different to program for, because the discord libraries are so tightly coupled with discord’s gateway, you have to write some things from scratch in order to operate on data from another source.

2 Likes