PHP code example of kostikpenzin / yii2-slackbot
1. Go to this page and download the library: Download kostikpenzin/yii2-slackbot library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kostikpenzin / yii2-slackbot example snippets
'components' => [
// ...
'slackbot' => [
'class' => 'kostikpenzin\SlackBot\Bot',
'_token' => 'Asdw-111111111-2222222222-3333333333',
'_channel' => 'Finanso_alert', // default channel
'_username' => 'Finanso_SlackBot',
'_icon' => ':mega:'
]
]
\Yii::$app
->slackbot
->message('Message.')
->send();
\Yii::$app
->slackbot
->channel('Finanso_alert')
->user('Finanso_SlackBot')
->icon(':mega:')
->message('Message.')
->send();