git clone https://github.com/pantc12/CPRTeam-TelegramBOT.git
cd CPRTeam-TelegramBOT
cp config.sample.php config.php
- Message http://telegram.me/BotFather and follow the guide to create a new bot
- Get your token, name and write it to
config.php
- Send a post request to
https://api.telegram.org/bot{TOKEN}/setWebhook?url={YOUR_WEBHOOK_URL}
- You must include your server SSL crt (public key) file in a POST field
certificate
(POST type = file) - If correct, telegram api should response
{
"ok": true,
"result": true,
"description": "Webhook was set"
}
- Message your bot
- tail -f hooks.log
The log will contain timestamp and webhook data from telegram webhooks api.