2017 © Pedro Peláez
 

library telegram-php-bot

Telegram Bot API written in PHP

image

curiouscoder/telegram-php-bot

Telegram Bot API written in PHP

  • Thursday, September 10, 2015
  • by curiouscoder
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Telegram Bot PHP API

Let's you integrate with Telegram Bot API using PHP., (*1)

Quick Start

Installation

Step 1: By using Composer, (*2)

$ composer require curiouscoder/telegram-php-bot

or, (*3)

composer.json file, (*4)

{
    "require": {
        "curiouscoder/telegram-php-bot": "dev-master"
    }
}

Step 2: Assuming composer's autoloader is made use of. [require 'vendor/autoload.php';], (*5)

use CuriousCoder\TelegramBot\TelegramBot;
use CuriousCoder\TelegramBot\Config\Config;

Step 3: Create new instance of Config class and set your api key. Check botfather to register your app., (*6)

$config = new Config();
$config->setApiKey("Your Key");

Step 4: Create new instance of TelegramBot class and pass your Config class instance, (*7)

$telegram = new TelegramBot($config);

All the methods listed on Telegam Bot API page are fully supported., (*8)

Example

To get info on your Bot, (*9)

print_r($telegram->getMe());

To send a text message, (*10)

$response = $telegram->sendMessage('CHAT_ID','Hello!');
print_r($response);

Extra info

By default video, audio, sticker and photo formats are preset. You can view or add formats using Config class, (*11)

$config = new Config();

$config->getAudioFormats();
$config->setAudioFormats(['mp3']);

$config->getVideoFormats();
$config->setVideoFormats(['avi']);

$config->getPhotoFormats();
$config->setPhotoFormats(['png','jpg']);

Contributing

Thank you for considering contributing to the project., (*12)

Disclaimer

This project and its author is neither associated, nor affiliated with Telegram in anyway. See License section for more details., (*13)

The Versions

10/09 2015

dev-master

9999999-dev

Telegram Bot API written in PHP

  Sources   Download

MIT

The Requires

 

by Vinay Kumar

api bot telegram telegram-bot