2017 © Pedro Peláez
 

library laravel-telegram

A simple and lightweight Laravel 4 and 5 wrapper to interact with Telegram Bot.

image

ricardofontanelli/laravel-telegram

A simple and lightweight Laravel 4 and 5 wrapper to interact with Telegram Bot.

  • Sunday, February 4, 2018
  • by ricardofontanelli
  • Repository
  • 2 Watchers
  • 8 Stars
  • 1,016 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 26 % Grown

The README.md

LaravelTelegram

A simple and lightweight Laravel 4.2 and Laravel 5.* wrapper to interact with Telegram Bot., (*1)

Get Started:

  • First of all, you should create a Telegram Bot, you can use Bot Father to do that;
  • Create a Telegram chat room (group) and add the Bot to this group, now the Bot can send messages!
  • After publish the package, open the telegram config file and provide all the required information.

Installation

1) The Laravel Telegram Service Provider can be installed via ..., (*2)

composer require ricardofontanelli/laravel-telegram:1.0 

or Composer by requiring the ricardofontanelli/laravel-telegram package in your project's composer.json, (*3)

{
    "require": {
        "ricardofontanelli/laravel-telegram": "1.0"
    }
}

Then run a composer update, (*4)

php composer update

2) To use the Laravel Telegram Service Provider, you must register the provider when bootstrapping your application. If you are using Laravel >= 5.5, the package supports Automatic Package Discovery, skip to the step 3., (*5)

In Laravel find the providers key in your config/app.php and register the Laravel Telegram Service Provider., (*6)

    'providers' => array(
        // ...
        'RicardoFontanelli\LaravelTelegram\TelegramServiceProvider',
    )

Find the aliases key in your config/app.php and add the Laravel Telegram facade alias., (*7)

    'aliases' => array(
        // ...
        'Telegram' => 'RicardoFontanelli\LaravelTelegram\TelegramFacade',
    )

3) After that, run the command above to publish the Telegram config file, you must provide your Telegram Bot credentials and chat room information., (*8)

Publishing the package

Now, you should publish the package to generate the config file, after that, edit the config file with your Telegram Bot credentials., (*9)

Laravel 4.2

The config file will be generate here: app/config/packages/ricardofontanelli/laravel-telegram/config.php, (*10)

php artisan config:publish ricardofontanelli/laravel-telegram

Laravel 5.*

The config file will be generate here: app/config/telegram.php, (*11)

php artisan vendor:publish --provider="RicardoFontanelli\LaravelTelegram\TelegramServiceProvider"

Send a message:

Now you can use it by php artisan tinker and run:, (*12)

// Send a message
Telegram::sendMessage('default', 'Here we go!');
// or async
Telegram::async()->sendMessage('default', 'Here we go!');

The first value is the config key name of the chat/group id where the Bot will publicate the message, you can provide the chat/group id directly., (*13)

Get information about the Bot:

// Send an async message
Telegram::getMe()->getResult();

Get Bot update:

// Send an async message
Telegram::getUpdates()->getResult();

Other methods:

The class has use a magic method to call unsuported methods:, (*14)

$params = ['method'=>'GET'];
Telegram::getWebhookInfo($params)->getResult()

You can use the variable $params to send query parameters and define the HTTP method (according the Telegram Bot Api documentation)., (*15)

Find more:

You can find more here (Telegram Bot API)[https://core.telegram.org/bots/api], but if you need to call a method that the class doesn't support, feel free to send a PR., (*16)

The Versions

04/02 2018

dev-master

9999999-dev https://github.com/ricardofontanelli/laravel-telegram

A simple and lightweight Laravel 4 and 5 wrapper to interact with Telegram Bot.

  Sources   Download

MIT BSD Style

The Requires

 

by Ricardo Fontanelli

laravel laravel 4 bot messages laravel 5 provider facade telegram service provider

04/02 2018

1.2

1.2.0.0 https://github.com/ricardofontanelli/laravel-telegram

A simple and lightweight Laravel 4 and 5 wrapper to interact with Telegram Bot.

  Sources   Download

MIT BSD Style

The Requires

 

by Ricardo Fontanelli

laravel laravel 4 bot messages laravel 5 provider facade telegram service provider

01/12 2017

dev-feature/test-suite

dev-feature/test-suite https://github.com/ricardofontanelli/laravel-telegram

A simple and lightweight Laravel 4 and 5 wrapper to interact with Telegram Bot.

  Sources   Download

BSD Style

The Requires

 

The Development Requires

by Ricardo Fontanelli

laravel laravel 4 bot messages laravel 5 provider facade telegram service provider

20/09 2017

1.1

1.1.0.0 https://github.com/ricardofontanelli/laravel-telegram

A simple and lightweight Laravel 4 and 5 wrapper to interact with Telegram Bot.

  Sources   Download

BSD Style

The Requires

 

by Ricardo Fontanelli

laravel laravel 4 bot messages laravel 5 provider facade telegram service provider

15/02 2017

1.0

1.0.0.0 https://github.com/ricardofontanelli/laravel-telegram

A simple and lightweight Laravel 4 and 5 wrapper to interact with Telegram Bot.

  Sources   Download

BSD Style

The Requires

 

by Ricardo Fontanelli

laravel laravel 4 bot messages laravel 5 provider facade telegram