bot-telegram For send message in telegram

  1. Installation
  2. Usage
  3. Resources

Installation

The preferred way to install this extension is through composer.

Either run ~~~ php composer.phar require aki/yii2-bot-telegram "" ~~~ or add ~~~ "aki/yii2-bot-telegram": "" ~~~ to the require section of your composer.json file.

Usage

frist add to config.php

<?php
'component' => [
    'telegram' => [
           'class' => 'aki\telegram\Telegram',
           'botToken' => '123456:a1dfco12er3b5yuh',
           'botUsername' => 'PostManGoBot'
    ]

]
?>

Once the extension is installed, simply use it in your code by :

<?= Yii::$app->telegram->sendMessage([
   'chat_id' => 'this is test message'
]); ?>

Resources

0 0
1 follower
0 downloads
Yii Version: 2.0
License: MIT
Category: Others
Developed by: akii
Created on: Sep 4, 2016
Last updated: 8 months ago

Related Extensions