naffiq/telegram-channel-php

Post to your telegram channel with ease!

v1.0.2 2018-04-23 08:25 UTC

This package is auto-updated.

Last update: 2024-11-23 01:46:38 UTC


README

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');