Skip to content

naffiq/telegram-channel-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Channel PHP

Build Status Code Climate Test Coverage

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

  1. Create bot via BotFather and get BOT_TOKEN from it
  2. Add it as an admin to your channel
  3. 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');