2017 © Pedro Peláez
 

yii2-extension yii2-bot-telegram

bot for telegram

image

mirkhamidov/yii2-bot-telegram

bot for telegram

  • Saturday, May 5, 2018
  • by miroff
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 500 % Grown

The README.md

Yii2 Telegram API

Installation

The preferred way to install this extension is through composer., (*1)

Either run, (*2)

php composer.phar require mirkhamidov/yii2-bot-telegram "*"

or add, (*3)

"mirkhamidov/yii2-bot-telegram": "*"

to the require section of your composer.json file., (*4)

Usage

first add to config.php, (*5)

<?php
'components' => [
    'telegram' => [
        'class' => 'mirkhamidov\telegramBot\TelegramBot',
        'botToken' => 'TOKEN HERE',
    ]
]
?>

Once the extension is installed, simply use it in your code by :, (*6)

<?php Yii::$app->telegram->sendMessage('Message'); ?>

send message width inline keyboard by:, (*7)

<?php Yii::$app->telegram->sendMessage('Message with inline keyboard', $chatId, [
        'reply_markup' => json_encode([
            'inline_keyboard'=>[
                [
                    ['text'=>"refresh",'callback_data'=> time()]
                ]
            ]
        ]),
    ] ?>

send photo by :, (*8)

<?php Yii::$app->telegram->sendPhoto('/app/pattern2.jpg', $chatId, [
    'caption' => 'some text',
]); ?>

TODO

  • Logging

PS: Inspired by aki/yii2-bot-telegram, (*9)

The Versions

05/05 2018

dev-master

9999999-dev

bot for telegram

  Sources   Download

BSD-3-Clause

The Requires

 

by Jasur Mirkhamidov

extension yii2 bot telegram