mcmatters/slack-api

v1.3 2020-04-01 22:24 UTC

This package is auto-updated.

Last update: 2020-07-31 00:30:33 UTC


README

Installation

composer require mcmatters/slack-api

Usage

<?php

use McMatters\SlackApi\Message;
use McMatters\SlackApi\SlackClient;

require 'vendor/autoload.php';

// Send message to webhook url.
Message::make('WEBHOOK_URL')
    ->from('Foo')
    ->to('#bar')
    ->icon(':robot_face:')
    ->text('Hello world')
    ->send();

// Use slack client wrapper
$client = new SlackClient('TOKEN');
$client->get('users.info', ['query' => ['user' => 'W1234567890']]);