Skip to content

kostikpenzin/yii2-slackbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii 2 SlackBot

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads

Yii bot for sending messages (alerts) to Slack.

Setup

Add the kostikpenzin/yii2-slackbot package to your composer.json

composer require kostikpenzin/yii2-slackbot

Add the component to your config in the components section:

'components' => [
    // ...
    'slackbot' => [
        'class' => 'kostikpenzin\SlackBot\Bot',
        '_token' => 'Asdw-111111111-2222222222-3333333333',
        '_channel' => 'Finanso_alert', // default channel
        '_username' => 'Finanso_SlackBot',
        '_icon' => ':mega:'
    ]
]

Using default settings in your Application:

\Yii::$app
  ->slackbot
  ->message('Message.')
  ->send();

Using custom settings in your Application:

\Yii::$app
  ->slackbot
  ->channel('Finanso_alert')
  ->user('Finanso_SlackBot')
  ->icon(':mega:')
  ->message('Message.')
  ->send();

About

Yii bot for sending messages (alerts) to Slack.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages