kostikpenzin / yii2-slackbot
Yii bot for sending messages (alerts) to Slack
v0.1.4
2021-06-08 14:30 UTC
Requires
- php: >=7.1
- curl/curl: ^2.3
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-12-08 21:50:54 UTC
README
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();