Telegram Bot Message Processor
This repository provides a simple PHP + Makefile setup to fetch Telegram updates and process incoming messages.
Overview
process_message.php– defines the functionprocess_message()where you can add your own logic for handling incoming messages (sending replies, saving data, etc.).Makefile– automates fetching updates, processing them, and cleaning data files.lib/main.php– expected to contain helper functions liketelegram_send_text()andtelegram_send_file().
How It Works
- Fetch updates : calls the Telegram Bot API (getUpdates) and stores raw JSON messages in data/*.update_id.json.
make fetch_updates
- Process updates : each update is passed to process_message.php, where you can customize your bot’s behavior.
make process_updates
- Clean data : removes all program generated files
make clean
Requirements:
- PHP CLI
- jq (for parsing JSON in make fetch_updates)
- curl
Description
Languages
PHP
82.2%
Makefile
17.8%