This little lib (1 class only!) helps you to push messages to your telegram channel via bot.
In order to install use composer:
$ composer require naffiq/telegram-channel-php
- Create bot via BotFather and get
BOT_TOKEN
from it - Add it as an admin to your channel
- Follow examples below to post messages or photos:
<?php
$manager = new \naffiq\telegram\channel\Manager(BOT_TOKEN, CHANNEL_NAME);
$manager->postMessage('Hello, fellas!');
<?php
$manager = new \naffiq\telegram\channel\Manager(BOT_TOKEN, CHANNEL_NAME);
$manager->postPhoto(__DIR__ . '/photo.jpeg', 'Put your label here');