naffiq / telegram-channel-php
Post to your telegram channel with ease!
Installs: 2 301
Dependents: 0
Suggesters: 0
Security: 0
Stars: 12
Watchers: 4
Forks: 5
Open Issues: 0
Requires
- longman/telegram-bot: ^0.47.1
Requires (Dev)
- codeclimate/php-test-reporter: ^0.4.4
- phpunit/phpunit: 5.7
- vlucas/phpdotenv: ^2.4
This package is auto-updated.
Last update: 2024-11-23 01:46:38 UTC
README
This little lib (1 class only!) helps you to push messages to your telegram channel via bot.
Installation
In order to install use composer:
$ composer require naffiq/telegram-channel-php
Usage
- 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:
Post message
<?php $manager = new \naffiq\telegram\channel\Manager(BOT_TOKEN, CHANNEL_NAME); $manager->postMessage('Hello, fellas!');
Post photo
<?php $manager = new \naffiq\telegram\channel\Manager(BOT_TOKEN, CHANNEL_NAME); $manager->postPhoto(__DIR__ . '/photo.jpeg', 'Put your label here');