1.4.6 • Published 3 years ago

slack-webhook-send v1.4.6

Weekly downloads
42
License
ISC
Repository
github
Last release
3 years ago

slack-webhook-send

Use v1.4.1 for CLI. Latest if using as a module.

This README is deprecated. Will update it as soon as I get time.

Global Usage

Install using npm i -g slack-webhook-send

slack-webhook-send WEBHOOK_URL \
  success|fail|skip|HEX color \
  header \
  < list of heading, value > \
  --buttons < list of buttons >

Use as a library

Install using npm i slack-webhook-send

  • Form a payload ( this uses Slack Attachment )
const slack	= require('slack-webhook-send')

const notifier = "#ABABAB" const header = "Hello from Mars" const keyVal = notifier, header, "Version", "10.0.3", "App Name", "bulwark", "Yea?", "http://programmingexcuses.com/" const buttons = "Yea?"

const payload = slack.getPayload (keyVal, buttons)

 - Send Slack Message
```bash
slack.send(SLACK_WEBHOOK_URL, payload)
	.then(res => console.log(res))
	.catch(err => console.log(err))

Functions

getPayload(args, buttons)

  • The first argument is a sequence of Header, Notifier type and a list of key-value pair.
  • Header - this is the main heading of Slack message.
  • Notifier type - this can be success, fail, skip or your own HEX value for the side bar color.
  • Key - value pair - this is a sequence of message content to be sent.

send(SLACK_WEBHOOK_URL, payload)

Refer for clarity

Slack Attachments

Incoming Webhooks

Notes

  • Button title needs to be followed by a valid URL or it is not gonna show up.
1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.1.4

4 years ago

1.0.5

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago