Extension Description
PythonAnywhere Managre
This extension is designed to easily manage and monitor your Python scripts (like Telegram bots) hosted on PythonAnywhere directly from your mobile device. Using the PythonAnywhere API, you can start your bot, stop it safely, and check its live console status right from your phone.
Blocks Overview
Properties (Configuration Blocks)
ApiToken: Sets or retrieves your PythonAnywhere API Token used for authorization.
AccountUsername: Sets or retrieves your PythonAnywhere account username.
ConsoleId: Sets or retrieves the ID of the specific console you want to control.
Events (Triggers)
OnActionComplete: Triggered when a start or stop command is successfully sent to the console. Returns isStarting (true/false) and a message.
OnStatusReceived: Triggered after checking the server. Returns isRunning (true if the bot is currently active) and the latest consoleOutput.
OnError: Triggered if there is a network issue, missing credentials, or an API failure.
Functions (Actions)
StartBot: Sends the execution command (python server.py) to the server to start the bot.
StopBot: Sends a Ctrl+C interrupt command to immediately stop the running bot.
CheckStatus: Connects to the server to fetch the latest console output and determine if the bot is currently running.
IsRunning: A quick local check that returns the last known status (true or false) without making a new network request.
Here is the translation into English:
"This extension was created primarily for the free plans on https://www.pythonanywhere.com, because on the free tier, a bot goes to sleep (shuts down) after a certain period of time. It can be configured alongside the background tasks extension (https://community.appinventor.mit.edu/t/open-source-background-tasks-itoo/55125) to monitor in the background whether the bot is running, and to call the StartBot function if it turns out to be inactive."
