1.0.6 • Published 3 years ago

slackcat v1.0.6

Weekly downloads
12
License
MIT
Repository
github
Last release
3 years ago

SlackCat

Pipe STDIN To Slack From The Command Line

Installing

npm install -g slackcat

Command Line Arguments (optional)

Output Channel ( Defaults to general )

-f general

Bot Name ( Defaults to Bot )

-n Bot

Bot Icon ( Defaults to computer )

-i :computer:

Bot Silent ( Defaults to false )

-s true

Bot Muted ( Defaults to false )

-m true

Environment Variables (required)

REQUIRED: Slack API Token ( see: https://my.slack.com/services/new/bot )

SLACKCAT_API_TOKEN = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

OPTIONAL: "Bot Channel"

SLACKCAT_CHANNEL = general

OPTIONAL: "Bot Name"

SLACKCAT_USERNAME = Bot

OPTIONAL: "Bot Icon"

SLACKCAT_ICON = :computer:

OPTIONAL: "Bot Silent"

SLACKCAT_SILENT = false

OPTIONAL: "Bot Muted"

SLACKCAT_MUTED = false

Usage

From The Command Line:

Say Hello Slack World! in the general channel.

echo "Hello Slack World!" | slackcat

Say Welcome To The Channel! in the welcome channel when you run this command

echo "Welcome To The Channel!" | slackcat -f welcome

Use all the command line options to ask Who Wants Cake? in the party channel with the :cake: icon and use the name Chef.

echo "Who Wants Cake?" | slackcat -f party -i :cake: -n Chef

Use the muted command line option to make your bot have an inner thought and not post to slack.

echo "What Is The Best Way To Slack?" | slackcat -f general -m true

Further Reading

Facts:

  • This module is heavily inspired by and loosely based off of the python module slackcat.
  • A 10 second delay occurs before slackcat will exit after the STDIO is closed. This gives the bot time to send the data to slack before exiting.
  • Silent mode makes SlackCat not emit to STDOUT.
  • Muted mode makes SlackCat not emit to SLACK.
  • Feature requests will not be taken but bug related issues will be addressed.
  • No cats were harmed in the making of this module.
  • Less than 1 cup of coffee and 2 hours of time was used in making this module
  • You can run this module with nodejs to output errors to slack. example: node server.js | slackcat

License

MIT

1.0.6

3 years ago

1.0.5

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