Can a telegram bot wake up a sleeping project?

I am pretty sure that it can’t but still asking. If the answer’s no, could you make it so that it can wake up?
Right now I am using a service to ping it every 10 minutes but that’s not that etical, and consumes resources from glitch.
Could I make it so that it only wakes up when a message’s received, a telegram bot can wake up the glitch project?
Thanks,
~D

If you can configure webhooks with telegram, then you should be able to. I use a twitter bot on glitch that is pinged eveytime a pull request is made on github to a repo I run. GitHub sends the project a POST request which also pings it and wakes it up.

1 Like

It seems like it does support it. It seems kinda complicated, but this is already a huge help --thanks.
As the telegram API quotes:

setWebhook

Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.

That post request should wake up the bot as it is a request.

Any request, POST requests included, will wake up the Glitch project. The thing to consider with webhooks specifically is a request timeout. A request that wakes a project up will take longer than a request to an already active project, and some requesting servers may not tolerate that delay. For all webhooks I’ve used (Twitter, Discord, and GitHub) this has never been an issue. I doubt Telegram would have an issue either, it says in your quote from the documentation that they’ll retry the webhook if it fails or times out.

1 Like