2017 © Pedro Peláez
 

library telegram-wrapper

PHP wrapper for Telegram bots

image

hetisniels/telegram-wrapper

PHP wrapper for Telegram bots

  • Saturday, November 19, 2016
  • by HetIsNiels
  • Repository
  • 2 Watchers
  • 7 Stars
  • 49 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

PHP Telegram Wrapper

Latest Version Total Downloads, (*1)

PHP wrapper for Telegram bots, (*2)

Install

This project uses Composer. To use the project, just add it to your dependencies., (*3)

``` bash $ composer require hetisniels/telegram-wrapper, (*4)

**Without Composer**

It is possible you dont like Composer or you just want to get the source and use it. In this case download the latest release in releases page.
Note: You need to make your own autoloader for this to work!

## Sample usage
### Telegram\Bot
``` php
<?php
class HelloWorldCommand implements \Telegram\Commands\ICommand
{
    public function call($name, $arguments, $caller)
    {
        $keyboard = $caller->getBot()->createKeyboard(); // Alternative: $keyboard = new KeyboardBuilder();
        $keyboard = $keyboard->button('A')->button('B')->row()->button('C')->button('D')->row()->setResizable(true)->setOneTime(true)->keyboard();

        $caller->reply('Hello World!', false, $keyboard);
    }

    public function getDescription()
    {
        return 'Sends the popular "Hello World" text.';
    }

    public function getUsage()
    {
        return '<command>';
    }
}

$bot = new Telegram\Bot('API_TOKEN');
$bot->addCommand('helloworld', new HelloWorldCommand());
$bot->work();

And now, just send the message "/helloworld" to the bot!, (*5)

Telegram\Api

``` php <?php $bot = new Telegram\Api('API_TOKEN');, (*6)

$bot->getUpdates(); // Returns array of Update ``` An custom command handler is needed when using the API. The API provides only the methods & types from Telegram., (*7)

The Versions

19/11 2016

dev-master

9999999-dev https://github.com/HetIsNiels/TelegramWrapper

PHP wrapper for Telegram bots

  Sources   Download

GPL-2.0

The Requires

  • php >=5.4.0

 

bot wrapper telegram telegram bot telegram sdk telegram api telegram wrapper

14/07 2015

0.2

0.2.0.0 https://github.com/HetIsNiels/TelegramWrapper

PHP wrapper for Telegram bots

  Sources   Download

GPL-2.0

The Requires

  • php >=5.4.0

 

bot wrapper telegram telegram bot telegram sdk telegram api telegram wrapper

06/07 2015

0.1.1

0.1.1.0 https://github.com/HetIsNiels/TelegramWrapper

PHP wrapper for Telegram bots

  Sources   Download

GPL-2.0

The Requires

  • php >=5.4.0

 

bot wrapper telegram telegram bot telegram sdk telegram api telegram wrapper

06/07 2015

0.1

0.1.0.0

PHP wrapper for Telegram bots

  Sources   Download

GPL-2.0

The Requires

  • php >=5.4.0

 

bot wrapper telegram