How to check if project is down, if so, return

how to check if project is down, if so, return
i whant this to record a downtime, if its down, it will send something in a specific discord channel

You could create a program that could check if the glitch project is returning a 503 error.

yeah! but how? can you sned some sort of example?!

This may help…

ill check it out! Thanks!

1 Like

wait, i have no idea what that is :expressionless:

Can you be a little bit more specific? What language are you coding in? Are you using discord.js or node.js? What are you trying to achieve?

discord.js, so wehn a bot goes offline, it will return something in a spicific channel in discord

You would need a separate server, not hosted on Glitch, to do this. When Glitch is down, you won’t be able to use Glitch to send a message to a Discord channel…

not glitch is down, my glitch project

When the Glitch project falls asleep? Checking whether the Glitch project is awake (by checking for a 503 error) will wake the project back up. Basically anytime you make a request to the project it will wake back up.

As far as I know, there’s no way to tell a Glitch project “run this piece of code right before you go to sleep but before you actually go to sleep”.

not that, run a piece of code any time after the bot goes to sleep

Who would run that code? The project is asleep…

another project would run it

Hmm I’m not sure, I’ve never seen it done. Why do you want that functionality?

so when the bot goes offline, it will record a downtime in my discord server for the current stats

Why do you want to record the times that your project is asleep? Wouldn’t this happen a lot, like after every 5 minutes of inactivity?

humn yea, something allong those lines

I’m still not quite seeing the reason for this, sorry.

As far as I know, there’s no way to do this (someone else correct me if I’m wrong!)

1 Like

alright! Thanks for your understanding!