StayPresent lets developers run multiple Python bots in a single process with independent crash recovery
StayPresent is a Python library that allows developers to run multiple bots — such as Telegram or Discord bots — within a single process using one staypresent.run() call. Each bot operates as an independent subprocess with its own restart counter and monitoring thread, meaning a crash in one bot does not affect the others. Developers can configure bots either via a simple list of file paths or through a detailed bots parameter that supports per-bot arguments and environment variables. The library validates all bot files before launching and handles startup failures cleanly by terminating any already-started processes to avoid orphaned instances. Once all bots finish or permanently fail, StayPresent returns a deterministic exit code based on the lowest-indexed failing bot, making it easier to manage multi-bot pipelines under a single deployment.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in