Push the message in Telegram channel.
The preferred way to install this component is through composer.
$ composer require bossit/yii2-telegram-logger:^1.0
The preferred way is to setup the components into our Application's configuration array:
'components' => [
'telegramLogger' => [
'class' => \bossit\logger\TelegramService::class,
'botKey' => 'xxx:zzz',
'botName' => 'YouNameBot',
'channelId' => '-100xxx'
],
],
That's it, you are ready to use them as Yii2 components.
\Yii::$app->telegramLogger->push('Hello, %username%!');
\Yii::$app->telegramLogger->push('Hello, %username%!', 'Authorization');