wow-apps/symfony-slack-bot

Simple Symfony 3 and 4 Bundle for sending customizeable messages to Slack via incoming webhooks

Installs: 1 823

Dependents: 0

Suggesters: 0

Stars: 14

Watchers: 5

Forks: 2

Open Issues: 0

Type:symfony-bundle

3.2.12 2018-10-09 15:21 UTC

README

SlackBot banner

SensioLabsInsight

Packagist version Packagist Downloads

Maintainability Codacy Badge Scrutinizer Code Quality

Travis CI Build Scrutinizer Build ContinuousPHP Build

Code Coverage

Symfony Slack Bot

Simple Symfony 3 and 4 Bundle for sending customizable messages to Slack via incoming webhooks.

Requires:

  • PHP 7.0+
  • Symfony 3.0+
  • Guzzle Client 6.0+

Installation:

Step 1: Download the Bundle

"require": {
        "wow-apps/symfony-slack-bot": "^3.2"
}

or

$ composer require wow-apps/symfony-slack-bot 

Step 2: Enable the Bundle (skip for Symfony 4)

// ./app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new WowApps\SlackBundle\WowAppsSlackBundle(),
    );

    // ...

    return $bundles
}

Step 3: Add configuration (skip for Symfony 4)

# SlackBot Configuration
wow_apps_slack:
    api_url: ""
    default_icon: "//cdn.wow-apps.pro/slackbot/slack-bot-icon-48.png"
    default_channel: "general"
    quote_color:
        default: "#607D8B"
        info: "#2196F3"
        warning: "#FF5722"
        success: "#8BC34A"
        danger: "#F44336"

Send test message:

To test your configuration, send test message by next command:

./bin/console wowapps:slackbot:test

Test command result preview

Documentation

News and updates:

Follow news and updates in my Telegram channel @wow_apps_pro or Twitter @alexey_samara_

Say thanks:

I don't ask for donates, I do what I do for free, for all development community. But I will be grateful if you inform me on the email in which project you are using this Bundle, as well as I will be glad to criticize and suggestions.

e-mail

License

MIT © 2016 - 2018 Alexey Samara & contributors

Contribute

Do you want to make a change? Pull requests are welcome.

Changelog of 3rd version:

Added

  • [3.2.12] Functions getIconUrl, setIconUrl, getIconEmoji and setIconEmoji
  • [3.2.12] Class SlackEmoji with many constants of Slack emojis
  • [3.2.12] Flag JSON_UNESCAPED_SLASHES for outgoing message body (Issue #9)
  • [3.2.12] Emoji format validator
  • [3.2.12] Some new tests
  • [3.2.9] All public methods was covered by tests
  • [3.2.8] More test coverage
  • [3.2.7] Template for new pull request
  • [3.2.7] PHPUnit configuration
  • [3.2.6] phpunit test for Traits
  • [3.2.6] Templates for creating an issue
  • [3.1.0] Compatibility for Symfony 3.1 up to 4.0 (issue #1)
  • [3.1.0] Message validation
  • [3.1.0] Custom exceptions
  • [3.1.0] Travis CI tests
  • [3.1.0] Missing phpDocs

Changed

  • [3.2.12] Fixed setting of message icon (Issue #9)
  • [3.2.12] Functions setIcon and getIcon for SlackBot DTO set as deprecated and will be removed in version 3.3 (Issue #9)
  • [3.2.12] Test command now send message with random emoji as icon
  • [3.2.11] Fixed bug. Messages always goes to default channel before
  • [3.2.10] Some cosmetic changes
  • [3.2.8] TravisCI configuration
  • [3.2.8] Little optimisation for Scrutinizer
  • [3.2.8] Little optimisation for Codacy
  • [3.2.7] TravisCI configuration
  • [3.2.6] Fixed wrong using of custom exception
  • [3.2.6] TravisCI configuration
  • [3.2.5] Fixed problem with missed services.yaml file (Issue #3)
  • [3.2.4] TravisCI configuration
  • [3.2.3] README file for Symfony 4 support
  • [3.2.2] Support for auto configuring bundle in Symfony Flex
  • [3.1.3] Licence from Apache 2 to MIT for Symfony Flex
  • [3.1.1] Namespaces from Wowapps to WowApps for a single standard of all my Bundles (hot fix for 3.1.0)
  • [3.1.0] Config parameter from wowapps_slack to wow_apps_slack for a single standard of all my Bundles
  • [3.1.0] Test command from slackbot:test to wowapps:slackbot:test for a single standard of all my Bundles

Removed

  • [3.2.0] symfony/symfony dependency for Symfony Flex
  • [3.1.0] Unused Controller
  • [3.1.0] Empty tests