Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

How to Stop Your Discord Bot From Sleeping on Render's Free Tier

A step-by-step tutorial to stop a discord bot from sleeping on Render's free tier — the real cause, the fix, and a working code example. How to Stop Your Discord Bot From Sleeping on Render's Free Tier You've deployed your Discord bot to Render's free tier, it worked for a bit, and now it's going offline — sometimes after a few minutes, sometimes randomly. This is one of the most common issues…

Discord bots deployed to Render's free tier may stop functioning due to Render checking the bot's health over HTTP and shutting down after a period without incoming traffic. The bot, which connects outward to Discord's gateway, does not open an HTTP port, leading to Render's health checker not knowing if the bot is functioning properly.

To address this issue, one can install "staypresent," a library specifically designed to keep Python applications running. By installing "staypresent[prod]" and adding its dependency to the "requirements.txt" file, developers can create a new "main.py" file that wraps the original bot code in "bot.py" using staypresent.web.json(). Additionally, the PORT environment variable provided by Render should be read dynamically to bind the application to it.

Render's start command should be set to "python main.py," allowing the bot to run properly within the free tier. Optionally, if inactivity sleep is a concern, developers can set up a self-ping to the app's public URL using staypresent.cron(). This change will prevent Render's free tier from prematurely shutting down the bot.

After implementing these steps, developers should verify that the bot remains healthy by checking Render's dashboard and the app's health endpoint. By following these steps, the bot should remain operational on Render's free tier without requiring any changes to the original bot code.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

"What's the Catch?" — Why StayPresent Is Actually Free

A tool that handles crash recovery, hang detection, and a full status page sounds like it should cost something. Here's why it doesn't, and won't.

  • StayPresent is free to use under MIT License.
  • No infrastructure costs, runs inside user's deployment.
  • Open source, transparent license, no hidden features.

Deploying Multiple Python Bots to a Single Railway Container

A tutorial for running two or more python bots on Railway inside one container and one service, with independent crash recovery for each.

  • Deploy multiple Python bots in a single Railway container to save costs.
  • Bots communicate through main.py entry point using StayPresent library.
  • Each bot runs as a separate subprocess with independent crash recovery.

The excluded-plugin setting that Playwright ignored — fixing browser-mode updates and false residual warnings

The symptom In browser-mode maintenance (Playwright, no SSH), plugins marked as "excluded from update checks" were still being updated.

  • Playwright's excluded-plugin setting ignored ignored plugins during browser-mode updates
  • Two changes implemented: per-checkbox evaluation and adjusted residual check
  • New functions normalize and compare ignored plugins for accurate maintenance

More from Thursday 20 August →