Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org).

## [0.3.0] - 2017-04-19
### Added
- Advanced message attachments can now be created using `AttachmentBuilder`.

## [0.2.5] - 2016-09-21
### Added
- You can now check if a `RealTimeClient` is currently connected with a `isConnected()` method.
Expand Down Expand Up @@ -73,7 +77,8 @@ This project adheres to [Semantic Versioning](http://semver.org).
- Ability to send messages to any open channel, group or DM, either with the web API or with the RTM API.


[unreleased]: https://github.com/sagebind/slack-client/compare/v0.2.5...HEAD
[unreleased]: https://github.com/sagebind/slack-client/compare/v0.3.0...HEAD
[0.3.0]: https://github.com/sagebind/slack-client/compare/v0.2.5...v0.3.0
[0.2.5]: https://github.com/sagebind/slack-client/compare/v0.2.4...v0.2.5
[0.2.4]: https://github.com/sagebind/slack-client/compare/v0.2.3...v0.2.4
[0.2.3]: https://github.com/sagebind/slack-client/compare/v0.2.2...v0.2.3
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

This is an API client for [Slack](http://slack.com) for PHP clients, with support for the [Real Time Messaging API](http://api.slack.com/rtm) (RTM API) using web sockets.

## Project status
This project is based on some outdated and unmaintained libraries, and itself is not being actively maintained.

## Overview
This library was created primarily for [Slackyboy](https://github.com/sagebind/slackyboy), but was branched off into its own codebase so it could be used in other projects as well. I created this client because existing clients were either too complicated to use, or buggy, or incomplete. This is also the first PHP client I am aware of to support Slack's RTM API.

Expand Down Expand Up @@ -53,16 +56,20 @@ $client->getChannelById('C025YTX9D')->then(function (\Slack\Channel $channel) us
Slack supports messages much more rich than plain text through attachments. The easiest way to create a custom message is with a `MessageBuilder`:

```php
use Slack\Message\{Attachment, AttachmentField};
use Slack\Message\{Attachment, AttachmentBuilder, AttachmentField};

$message = $client->getMessageBuilder()
->setText('Hello, all!')
->setChannel($someChannelObject)
->addAttachment(new Attachment('My Attachment', 'attachment text'))
->addAttachment(new Attachment('Build Status', 'Build failed! :/', 'build failed', 'danger')))
->addAttachment(new Attachment('Some Fields', 'fields', null, '#BADA55', [
new AttachmentField('Title1', 'Text', false),
new AttachmentField('Title2', 'Some other text', true)
->addAttachment(new Attachment('Build Status', 'Build failed! :/', 'build failed', 'danger'))
->addAttachment(new AttachmentBuilder()
->setTitle('Some Fields')
->setText('fields')
->setColor('#BADA55')
->addField(new AttachmentField('Title1', 'Text', false))
->addField(new AttachmentField('Title2', 'Some other text', true))
->create()
]))
->create();

Expand Down
Loading