PHPackages                             xteam/slackmessengerbundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. xteam/slackmessengerbundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

xteam/slackmessengerbundle
==========================

An integration bundle with slack

v0.1.1(10y ago)047MITPHPPHP &gt;=5.5

Since Jul 23Pushed 10y agoCompare

[ Source](https://github.com/piotrpasich/SlackMessengerBundle)[ Packagist](https://packagist.org/packages/xteam/slackmessengerbundle)[ RSS](/packages/xteam-slackmessengerbundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

SlackMessenger
==============

[](#slackmessenger)

This bundle allows you to receive and publish messages from Slack mapped to `Message` objects.

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/738ce0511e526af799b428c56b78f2c3b712544a3cf5b61dc8c96727aee687e9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70696f74727061736963682f536c61636b4d657373656e6765722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/piotrpasich/SlackMessenger/?branch=master)[![ScrutinizerBuild Status](https://camo.githubusercontent.com/07b8f96973c4b0204b0d2c48a33fa572e65517d0e572c38268774d6dfe7b9eb5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70696f74727061736963682f536c61636b4d657373656e6765722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/piotrpasich/SlackMessenger/build-status/master)[![Travis Build Status](https://camo.githubusercontent.com/b0df51098286f6e649301e09cbc85702c074f33079e806f1e6701ebc1c07b203/68747470733a2f2f7472617669732d63692e6f72672f70696f74727061736963682f536c61636b4d657373656e6765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/piotrpasich/SlackMessenger)[![SensioLabsInsight](https://camo.githubusercontent.com/5da95714d67ccfbec6bc664e89eb025173d229353ce86ba1c0254399c6e0cfd3/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61356532646331662d373966642d343037372d393165662d3136386630313431663634652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/a5e2dc1f-79fd-4077-91ef-168f0141f64e)

Extending
---------

[](#extending)

To receive messages you need to create an EventListener which will be listening to the event `slack.message_received`

Example:

```
namespace PP\AwesomeBundle\EventListener;

use XTeam\SlackMessengerBundle\Event\MessageEvent;

class AwesomeWorkListener
{
    public function doYourJob(MessageEvent $event)
    {
        $message = $event->getMessage();
        /** Do the right job **/
    }
}

```

And register this in `services.yml`

```
;PP/AwesomeBundle/Resources/config/service.yml
services:
    pp_awesome.awesome.listener:
        class: %pp_awesome.awesome.listener.class%
        tags:
            - { name: kernel.event_listener, event: slack.message_received, method: doYourJob }

```

Installation
------------

[](#installation)

### Step 1: Composer require

[](#step-1-composer-require)

```
$ php composer.phar require xteam/slackmessengerbundle "dev-master"
```

### Step 2: Enable the bundle

[](#step-2-enable-the-bundle)

Enable the bundle in the kernel:

```
