2017 © Pedro Peláez
 

yii2-extension yii2-telegram

Support chat for site based on Telegram bot

image

wildan99/yii2-telegram

Support chat for site based on Telegram bot

  • Wednesday, December 13, 2017
  • by wildan99
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 0 Open issues
  • 20 Versions
  • 0 % 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 onmotion/yii2-telegram

add to your web config:, (*7)

 'modules' => [
     //...
    'telegram' => [
        'class' => 'onmotion\telegram\Module',
        'API_KEY' => 'forexample241875489:AdfgdfFuVJdsKa1cycuxra36g4dfgt66',
        'BOT_NAME' => 'YourBotName_bot',
        'hook_url' => 'https://yourhost.com/telegram/default/hook', // must be https! (if not prettyUrl https://yourhost.com/index.php?r=telegram/default/hook)
        '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' => 'onmotion\telegram\Module',
         'API_KEY' => 'forexample241875489:AdfgdfFuVJdsKa1cycuxra36g4dfgt66',
         'BOT_NAME' => 'YourBotName_bot',
     'hook_url' => 'https://yourhost.com/telegram/default/hook', // must be https! (if not prettyUrl https://yourhost.com/index.php?r=telegram/default/hook)
         'PASSPHRASE' => 'passphrase for login',
     ]
 ],       

run migrations:, (*9)

php yii migrate --migrationPath=@vendor/onmotion/yii2-telegram/migrations #that add 4 tables in your DB

go to https://yourhost.com/telegram/default/set-webhook (if not prettyUrl https://yourhost.com/index.php?r=telegram/default/set-webhook), (*10)

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

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

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

chat button, (*13)

if you click it:, (*14)

client chat, (*15)

and server side:, (*16)

client chat, (*17)

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

#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/onmotion/yii2-telegram/Commands and add path to this in config, for example:, (*19)

'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., (*20)

The Versions

13/12 2017

dev-master

9999999-dev

Support chat for site based on Telegram bot

  Sources   Download

MIT

The Requires

 

extension yii2 bot module telegram chat

22/10 2017

v0.8.5

0.8.5.0

Support chat for site based on Telegram bot

  Sources   Download

MIT

The Requires

 

extension yii2 bot module telegram chat

13/06 2017

0.8.4

0.8.4.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