PHP library for interacting with slack

1.0.2 2024-02-19 08:07 UTC

This package is auto-updated.

Last update: 2024-04-19 08:26:24 UTC


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