1.0.6 • Published 5 years ago
slackcat v1.0.6
SlackCat
Pipe STDIN To Slack From The Command Line
Installing
npm install -g slackcatCommand Line Arguments (optional)
Output Channel ( Defaults to general )
-f generalBot Name ( Defaults to Bot )
-n BotBot Icon ( Defaults to computer )
-i :computer:Bot Silent ( Defaults to false )
-s trueBot Muted ( Defaults to false )
-m trueEnvironment Variables (required)
REQUIRED: Slack API Token ( see: https://my.slack.com/services/new/bot )
SLACKCAT_API_TOKEN = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxOPTIONAL: "Bot Channel"
SLACKCAT_CHANNEL = generalOPTIONAL: "Bot Name"
SLACKCAT_USERNAME = BotOPTIONAL: "Bot Icon"
SLACKCAT_ICON = :computer:OPTIONAL: "Bot Silent"
SLACKCAT_SILENT = falseOPTIONAL: "Bot Muted"
SLACKCAT_MUTED = falseUsage
From The Command Line:
Say Hello Slack World! in the general channel.
echo "Hello Slack World!" | slackcatSay Welcome To The Channel! in the welcome channel when you run this command
echo "Welcome To The Channel!" | slackcat -f welcomeUse 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 ChefUse 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 trueFurther 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