Deploy once, use everywhere. A Telegram bot to monitor all your apps and send reports straight to your DM.
- Telegram Bot: Create a Telegram bot and obtain its token. Add it to the
.env
file asTELEGRAM_BOT_TOKEN
. - Node.js and npm/yarn: Ensure Node.js and npm (or yarn) are installed. Download them from the official Node.js website.
- Sends API reports directly to your Telegram DM.
- Seamlessly integrates with any application.
- Periodically provides "proof of life" updates.
-
Clone this repository:
git clone https://github.com/mjavason/telegram-monitor-bot.git
-
Navigate to the project directory:
cd telegram-monitor-bot
-
Install the dependencies:
npm install
-
Create a
.env
file in the project root and configure it with the following variables:TELEGRAM_BOT_TOKEN=your-telegram-bot-token PORT=5000 BASE_URL=http://localhost:5000
Run the project with hot-reloading for development:
npm run dev
Generate a production-ready build:
npm run build
Run the app using the production build:
npm run start
Run the test suite to ensure functionality:
npm run test
- Start the application using one of the commands above.
- Open your Telegram bot and send the
/start
command to set yourself as the bot owner. - Use the provided API endpoints to send reports.
Send a report to the bot.
-
Parameters:
app
(required) - The name of the application. -
Body: JSON payload containing the report details.
-
Example:
curl -X POST http://localhost:5000/report/my-app \ -H "Content-Type: application/json" \ -d '{"status": "All systems operational"}'
Check if the API is live.
-
Response:
{ "message": "API is Live!" }
- Periodic Updates: The bot sends "proof of life" updates to Telegram every 4 hours.
- Self-Ping: The application pings itself every 10 minutes to prevent idling.
- Configuration: Review the
env.sample
file for guidance on setting up your.env
file correctly.
Enjoy seamless monitoring with Telegram-Monitor-Bot!