yii2-extension yii2-telegram-bot-api
Telegram bot api component for Yii2
sonko-dmitry/yii2-telegram-bot-api
Telegram bot api component for Yii2
- Friday, July 31, 2015
- by SonkoDmitry
- Repository
- 4 Watchers
- 16 Stars
- 5,245 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 3 Forks
- 0 Open issues
- 2 Versions
- 11 % Grown
Telegram bot API for Yii2
, (*1)
This extension is the way to integrate telegram-bot/api wrapper with your Yii2 application., (*2)
Installation
The preferred way to install this extension is through composer., (*3)
To install, either run
$ php composer.phar require sonko-dmitry/yii2-telegram-bot-api:*
or add
"sonko-dmitry/yii2-telegram-bot-api": "*"
to the require
section of your composer.json
file., (*4)
Usage
-
Add the component configuration in your global main.php
config file:, (*5)
'components' => [
'bot' => [
'class' => 'SonkoDmitry\Yii\TelegramBot\Component',
'apiToken' => 'YOUR_BOT_API_TOKEN',
],
],
-
Now you can use component, (*6)
\Yii::$app->bot->sendMessage(1234567, 'Hello world!');
Where "1234567" receiver telegram id or chat id., (*7)