Download the PHP package geekdpt/slamp without Composer
On this page you can find all versions of the php package geekdpt/slamp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download geekdpt/slamp
More information about geekdpt/slamp
Files in geekdpt/slamp
Package slamp
Short Description Asynchronous Slack client for PHP, with Web & RTM APIs support
License MIT
Informations about the package slamp

slamp
An asynchronous Slack RTM & Web APIs client for PHP 7, powered by the Amp asynchronous framework, providing a typed experience and full-featured interfaces.
Forget those cURL wrappers and go async!
- Installation
- Usage we'll learn how to do those node-ish things
- Slamp APIs
- Web API call any Slack Web API methods
- Web API - Simple Message Composing a fluent API for sending messages
- RTM API realtime connection to your Slack team!
- Error handling because sh** always happens
Installation
Usage
Web API
Simple Message Composing
Inspired by maknz/slack, this API is based on top of the Web API and intends to provide a simple interface for sending messages to channels, groups or IM channels.
You have to create a Web API client to begin, then call compose()
to create a new message instance.
A basic usage example could be:
You can also set the target channel and/or the bot name :
The to("...")
argument supports different notations:
#channel
,C024BE91L
for a public channelprivate-group
,G012AC86C
for a private group@username
to post an IM message to the @slackbot inbox of the receiver (you will not appear as "slackbot")D023BB3L2
to post as the bot itself (and not slackbot like before) (you have to create such channel before)
You can even edit messages or delete them after they are sent:
Here is a more complete list of the possible calls:
Note: attachments are not yet supported.
Warning: Please do not rely on the type behind these methods. Just use the methods. Don't manipulate the MessageComposer direclty, as the way it is created may change radically in a future version.