Switch branches/tags
moleculer-twilio@1.0.10 moleculer-twilio@1.0.9 moleculer-twilio@1.0.8 moleculer-twilio@1.0.7 moleculer-twilio@1.0.6 moleculer-twilio@1.0.5 moleculer-twilio@1.0.4 moleculer-twilio@1.0.3 moleculer-twilio@1.0.2 moleculer-twilio@1.0.1 moleculer-twilio@1.0.0 moleculer-slack@1.1.0 moleculer-slack@1.0.0 moleculer-mail@1.2.1 moleculer-mail@1.2.0 moleculer-mail@1.1.1 moleculer-mail@1.1.0 moleculer-mail@1.0.8 moleculer-mail@1.0.7 moleculer-mail@1.0.6 moleculer-mail@1.0.5 moleculer-mail@1.0.4 moleculer-mail@1.0.3 moleculer-mail@1.0.2 moleculer-mail@1.0.1 moleculer-mail@1.0.0 moleculer-fake@1.0.12 moleculer-fake@1.0.11 moleculer-fake@1.0.10 moleculer-fake@1.0.9 moleculer-fake@1.0.8 moleculer-fake@1.0.7 moleculer-fake@1.0.6 moleculer-fake@1.0.5 moleculer-fake@1.0.4 moleculer-fake@1.0.3 moleculer-fake@1.0.2 moleculer-fake@1.0.1 moleculer-fake@1.0.0 moleculer-elasticsearch@1.1.1 moleculer-elasticsearch@1.1.0 moleculer-elasticsearch@1.0.6 moleculer-elasticsearch@1.0.5 moleculer-elasticsearch@1.0.4 moleculer-elasticsearch@1.0.3 moleculer-elasticsearch@1.0.2 moleculer-elasticsearch@1.0.1 moleculer-elasticsearch@1.0.0 moleculer-db@0.6.3 moleculer-db@0.6.2 moleculer-db@0.6.1 moleculer-db@0.6.0 moleculer-db@0.5.2 moleculer-db@0.5.1 moleculer-db@0.5.0 moleculer-db@0.4.5 moleculer-db@0.4.4 moleculer-db@0.4.3 moleculer-db@0.4.2 moleculer-db@0.4.1 moleculer-db@0.4.0 moleculer-db@0.3.3 moleculer-db@0.3.2 moleculer-db@0.3.1 moleculer-db@0.3.0 moleculer-db@0.2.0 moleculer-db@0.1.3 moleculer-db@0.1.2 moleculer-db@0.1.1 moleculer-db@0.1.0 moleculer-db-adapter-sequelize@0.1.4 moleculer-db-adapter-sequelize@0.1.3 moleculer-db-adapter-sequelize@0.1.2 moleculer-db-adapter-sequelize@0.1.1 moleculer-db-adapter-sequelize@0.1.0 moleculer-db-adapter-mongoose@0.4.4 moleculer-db-adapter-mongoose@0.4.3 moleculer-db-adapter-mongoose@0.4.2 moleculer-db-adapter-mongoose@0.4.1 moleculer-db-adapter-mongoose@0.4.0 moleculer-db-adapter-mongoose@0.3.1 moleculer-db-adapter-mongoose@0.3.0 moleculer-db-adapter-mongoose@0.2.0 moleculer-db-adapter-mongoose@0.1.2 moleculer-db-adapter-mongoose@0.1.1 moleculer-db-adapter-mongoose@0.1.0 moleculer-db-adapter-mongo@0.1.4 moleculer-db-adapter-mongo@0.1.3 moleculer-db-adapter-mongo@0.1.2 moleculer-db-adapter-mongo@0.1.1 moleculer-db-adapter-mongo@0.1.0 moleculer-bull@0.2.2 moleculer-bull@0.2.1 moleculer-bull@0.2.0 moleculer-bull@0.1.8 moleculer-bull@0.1.7 moleculer-bull@0.1.6 moleculer-bull@0.1.5 moleculer-bull@0.1.4 moleculer-bull@0.1.3
Nothing to show
Find file History
icebob Publish
 - moleculer-bee-queue@0.1.5
 - moleculer-bull@0.2.2
 - moleculer-elasticsearch@1.1.1
 - moleculer-fake@1.0.12
 - moleculer-mail@1.2.1
 - moleculer-slack@1.1.0
 - moleculer-twilio@1.0.10
Latest commit 9428eb0 Aug 3, 2018
Permalink
..
Failed to load latest commit information.
examples FIX comments, dependencies May 25, 2018
src
test/unit
.gitignore Add moleculer-slack addon May 21, 2018
CHANGELOG.md update slack Aug 3, 2018
LICENSE Add moleculer-slack addon May 21, 2018
README.md update slack Aug 3, 2018
index.js FIX comments, dependencies May 25, 2018
package-lock.json update deps Aug 3, 2018
package.json Publish Aug 3, 2018

README.md

Moleculer logo

moleculer-slack NPM version

Send Messages to Slack API.

Install

$ npm install moleculer-slack --save

Usage

Before use please set the SLACK_TOKEN and SLACK_CHANNEL environment variables.

let { ServiceBroker }     = require("moleculer");
let SlackService             = require("../../index");

// Create broker
let broker = new ServiceBroker({ logger: console });

// Load my service
broker.createService({
    name: "slack",
    mixins: [SlackService]
});

// Start server
broker.start().then(() => {

    broker
        .call("slack.send", { message: "Hello Slack!" })
        .then(res => console.log("Slack message sent. Sid:", res.ts))
        .catch(console.error);

});

Settings

Property Type Default Description
slackToken String required Slack API Token. Visit your Slack App dashboard's main page. Click "Create App, Generate Token", then copy and paste your "API TOKEN" here.
slackChannel String null Slack API Token. Visit your Slack App dashboard's main page. Add incoming webhook and create/select a channel, then copy and paste here.

Actions

send

Send a Slack Message

Parameters

Property Type Default Description
message String required Message text
channel String null Channel name

Results

Type: String

Methods

sendMessage

Send a slack message

Parameters

Property Type Default Description
message String - Body of the message
channel String - Channel name

Results

Type: String

Test

$ npm test

In development with watching

$ npm run ci

License

The project is available under the MIT license.

Contact

Copyright (c) 2016-2018 Ice Services

@ice-services @MoleculerJS