2017 © Pedro Peláez
 

yii2-extension yii2-telegram

Support chat for site based on Telegram bot

image

rustam95/yii2-telegram

Support chat for site based on Telegram bot

  • Tuesday, September 26, 2017
  • by RustamWin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 19 Versions
  • 100 % Grown

The README.md

Telegram support Bot for Yii2

Latest Stable Version Total Downloads License Daily Downloads Monthly Downloads, (*1)

Support chat for site based on Telegram bot, (*2)

The Bot logic based on akalongman/php-telegram-bot, so you can read Instructions by longman how to register Telegram Bot and etc., (*3)

Now only telegram webhook api support. You need SSL cert! Doesn't work on http!, (*4)

Installation

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

Run, (*6)

composer require rustam95/yii2-telegram

add to your web config:, (*7)

 'modules' => [
     //...
    'telegram' => [
        'class' => 'rustam95\telegram\Module',
        'API_KEY' => 'forexample241875489:AdfgdfFuVJdsKa1cycuxra36g4dfgt66',
        'BOT_NAME' => 'YourBotName_bot',
        'hook_url' => 'https://yourhost.com/telegram/default/hook', // must be https!
        'PASSPHRASE' => 'passphrase for login',
        // 'db' => 'db2', //db file name from config dir
        // 'userCommandsPath' => '@app/modules/telegram/UserCommands',
        // 'timeBeforeResetChatHandler' => 60
    ]
    //more...
 ]

and to console config:, (*8)

 'bootstrap' => [   
 //other bootstrap components...
                'telegram'],
 'modules' => [
         //...
     'telegram' => [
         'class' => 'rustam95\telegram\Module',
         'API_KEY' => 'forexample241875489:AdfgdfFuVJdsKa1cycuxra36g4dfgt66',
         'BOT_NAME' => 'YourBotName_bot',
     ]
 ],       

go to https://yourhost.com/telegram/default/set-webhook, (*9)

Now you can place where you want, (*10)

echo \rustam95\telegram\Telegram::widget(); //that add chat button in the page

in bottom right corner you can see:, (*11)

chat button, (*12)

if you click it:, (*13)

client chat, (*14)

and server side:, (*15)

client chat, (*16)

If you want to limit the storage period of messages history, add to you crontab:, (*17)

#leave 5 days (if empty - default = 7)
php yii telegram/messages/clean 5

Also you can use custom commands. To do this, you should copy UserCommands dir from /vendor/modules/yii2-telegram/Commands and add path to this in config, for example:, (*18)

'userCommandsPath' => '@app/modules/telegram/UserCommands'

timeBeforeResetChatHandler - the number of minutes before chat handler will be killed (if he forgot do /leavedialog). Never kill if 0 or not setted., (*19)

The Versions

26/09 2017

dev-master

9999999-dev

Support chat for site based on Telegram bot

  Sources   Download

MIT

The Requires

 

extension yii2 bot module telegram chat

26/09 2017

1.0.1

1.0.1.0

Support chat for site based on Telegram bot

  Sources   Download

MIT

The Requires

 

extension yii2 bot module telegram chat

24/01 2017

v0.8.3

0.8.3.0

Support chat for site based on Telegram bot

  Sources   Download

MIT

The Requires

 

extension yii2 bot module telegram chat

21/12 2016

v0.8.2

0.8.2.0

Support chat for site based on Telegram bot

  Sources   Download

MIT

The Requires

 

extension yii2 bot module telegram chat

24/11 2016

v0.8.1

0.8.1.0

Support chat for site based on Telegram bot

  Sources   Download

MIT

The Requires

 

extension yii2 bot module telegram chat

23/11 2016

v0.8.0

0.8.0.0

Support chat for site based on Telegram bot

  Sources   Download

MIT

The Requires

 

extension yii2 bot module telegram chat

18/11 2016

v0.7.1

0.7.1.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

extension yii2 bot module telegram chat

18/11 2016

v0.7.0

0.7.0.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

extension yii2 bot module telegram chat

25/10 2016

v0.6.3

0.6.3.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

extension yii2 bot module telegram chat

05/09 2016

v0.6.2

0.6.2.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

extension yii2 bot module telegram chat

30/08 2016

v0.6.1

0.6.1.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

extension yii2 bot module telegram chat

22/08 2016

v0.6

0.6.0.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

yii2 extension module chat telegram bot

22/08 2016

v0.5.1

0.5.1.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

yii2 extension module chat telegram bot

19/08 2016

v0.5

0.5.0.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

yii2 extension module chat telegram bot

11/08 2016

v0.4

0.4.0.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

yii2 extension module chat telegram bot

10/08 2016

v0.3

0.3.0.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

yii2 extension module chat telegram bot

09/08 2016

v0.2

0.2.0.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

yii2 extension module chat telegram bot

09/08 2016

dev-wiki

dev-wiki

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

yii2 extension module chat telegram bot

09/08 2016

v0.1

0.1.0.0

Support chat for site based on Telegram bot

  Sources   Download

GPL-3.0

The Requires

 

yii2 extension module chat telegram bot