2017 © Pedro Peláez
 

library telegramlibrary

PHP Library for the new Telegram Bot API

image

tekook/telegramlibrary

PHP Library for the new Telegram Bot API

  • Friday, May 26, 2017
  • by tekook
  • Repository
  • 3 Watchers
  • 16 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 2 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

PHP-TelegramLibrary

PHP Library for the new Telegram Bot API, (*1)

  • Event based programming for the new bot api
  • Closures
  • Composer Ready
  • Fully OOP
  • All Methods and Types available
  • Documented

Usage

Initiate the TelegramBotApi object with your token. Register the wanted hook within the event handler Use the central "pushUpdate" Method to start the Handling, (*2)

Example

use Tekook\TelegramLibrary;

$telegram = new TelegramLibrary\TelegramBotApi("<your token>");


$eventHandler = $telegram->getEventHandler();
$eventHandler->addHook(TelegramLibrary\Events::TEXT,
        function(\Tekook\TelegramLibrary\Types\Message $message) {
    if ($message->getText() == "A") {
        $message->reply("OK", ["reply_markup" => new TelegramLibrary\Markups\ReplyKeyboardHide()]);
    } else {
        $message->reply("Hello, " . $message->getFrom()->getFirstName() . " please answer A!",
                [
            "reply_markup" => new TelegramLibrary\Markups\ReplyKeyboardMarkup([
                ["A", "B"],
                ["C", "D"],
                ["E", "F"],
                    ])
        ]);
    }
});

$telegram->pushUpdate();

Author

Julian Tekook, (*3)

The Versions

26/05 2017

dev-master

9999999-dev https://github.com/tekook/TelegramLibrary

PHP Library for the new Telegram Bot API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Julian Tekook

api library bot telegram new api

14/04 2016

dev-tekook-patch-1

dev-tekook-patch-1 https://github.com/tekook/TelegramLibrary

PHP Library for the new Telegram Bot API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Julian Tekook

api library bot telegram new api

30/06 2015

1.0.3

1.0.3.0 https://github.com/tekook/TelegramLibrary

PHP Library for the new Telegram Bot API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Julian Tekook

api library bot telegram new api

29/06 2015

1.0.2

1.0.2.0 https://github.com/tekook/TelegramLibrary

PHP Library for the new Telegram Bot API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Julian Tekook

api library bot telegram new api

29/06 2015

1.0.1

1.0.1.0 https://github.com/tekook/TelegramLibrary

PHP Library for the new Telegram Bot API

  Sources   Download

The Requires

  • php >=5.4.0

 

by Julian Tekook

api library bot telegram new api