talentrydev / slack
PHP library for interacting with slack
3.0.0
2024-06-14 14:46 UTC
Requires
- php: ^8.3
- ext-json: *
- guzzlehttp/guzzle: ^6 || ^7
Requires (Dev)
- phpunit/phpunit: ^11
- squizlabs/php_codesniffer: ^3.5
README
This is a thin library for interacting with Slack. Currently, it supports sending messages and uploading files.
Installing
- Run:
composer require talentrydev/slack
Usage example
$apiToken = ''; //generate the token in slack
$guzzleClient = new \GuzzleHttp\Client();
$slack = new \Talentry\Slack\SlackClient($apiToken, $guzzleClient);
$channel = $slack->getChannel('general');
if ($slackChannel !== null) {
$slack->sendPlainTextMessage('Hello world!', $slackChannel);
}
Development
- Install dependencies:
make deps
- Run tests:
make test