2017 © Pedro Peláez
 

library tigris

Tigris is a modern Telegram bot framework written in PHP

image

tigris/tigris

Tigris is a modern Telegram bot framework written in PHP

  • Monday, July 31, 2017
  • by lagman
  • Repository
  • 2 Watchers
  • 4 Stars
  • 73 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Tigris: Telegram Bot Framework

Build Status Join the chat at https://gitter.im/tigris-php/tigris GitHub license, (*1)

Tigris is a modern reactive event-driven Telegram bot framework written in PHP., (*2)

Usage

Without extending the Bot class

Create a bot instance, (*3)

$bot = (new BotFactory())->create($apiToken);

Define your custom even handlers, (*4)

$bot = (new BotFactory())->create($apiToken);
$bot->addListener(MessageEvent::EVENT_TEXT_MESSAGE_RECEIVED, function (MessageEvent $event) use ($bot) {
    // sending your first message
    $bot->getApi()->sendMessage([
        'chat_id' => $event->message->chat->id, 
        'text' => 'Hello World!',
    ]);
});

Run your bot, (*5)

$bot->run();

Extending the Bot class

Extend the Tigris\Bot class to create your own bot implementation, (*6)

class SampleBot extends \Tigris\Bot
{
    // bootstraping your bot
    public function bootstrap()
    {
        // registering event callback
        $this->addListener(MessageEvent::EVENT_TEXT_MESSAGE_RECEIVED, function (MessageEvent $event) {
            // sending your first message
            $this->getApi()->sendMessage([
                'chat_id' => $event->message->chat->id, 
                'text' => 'Hello World!',
            ]);
        });   
    }
}

Run the bot instance, (*7)

$bot = (new BotFactory(SampleBot::class))->create($apiToken);
$bot->run();

License

MIT, (*8)

The Versions

31/07 2017

dev-master

9999999-dev

Tigris is a modern Telegram bot framework written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

api framework bot telegram

31/07 2017

0.2.5

0.2.5.0

Tigris is a modern Telegram bot framework written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

api framework bot telegram

31/07 2017

0.2.4

0.2.4.0

Tigris is a modern Telegram bot framework written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

api framework bot telegram

26/07 2017

0.2.3

0.2.3.0

Tigris is a modern Telegram bot framework written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

api framework bot telegram

26/07 2017

0.2.2

0.2.2.0

Tigris is a modern Telegram bot framework written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

api framework bot telegram

26/07 2017

0.2.1

0.2.1.0

Tigris is a modern Telegram bot framework written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

api framework bot telegram

26/07 2017

0.2

0.2.0.0

Tigris is a modern Telegram bot framework written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

api framework bot telegram

28/02 2017

0.1.1

0.1.1.0

Tigris is a modern Telegram bot framework written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

api framework bot telegram

08/11 2016

0.1

0.1.0.0

Tigris is a modern Telegram bot framework written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

api framework bot telegram