Skip to content

bossit/yii2-telegram-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yii2-telegram-logger

Push the message in Telegram channel.

Latest Stable Version Build Status Total Downloads

Install

The preferred way to install this component is through composer.

$ composer require bossit/yii2-telegram-logger:^1.0  

Usage

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.

Send a message to channel:
\Yii::$app->telegramLogger->push('Hello, %username%!');
Send a message with title to channel:
\Yii::$app->telegramLogger->push('Hello, %username%!', 'Authorization');

About

Push the message in Telegram channel.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages