sonko-dmitry / yii2-telegram-bot-api
Telegram bot api component for Yii2
Installs: 30 476
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 5
Forks: 6
Open Issues: 1
Type:yii2-extension
Requires
This package is auto-updated.
Last update: 2024-11-21 21:01:29 UTC
README
This extension is the way to integrate telegram-bot/api wrapper with your Yii2 application.
Installation
The preferred way to install this extension is through composer.
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.
Usage
- Add the component configuration in your global
main.php
config file:
'components' => [ 'bot' => [ 'class' => 'SonkoDmitry\Yii\TelegramBot\Component', 'apiToken' => 'YOUR_BOT_API_TOKEN', ], ],
- Now you can use component
\Yii::$app->bot->sendMessage(1234567, 'Hello world!');
Where "1234567" receiver telegram id or chat id.