Giter Site home page Giter Site logo

slacksay's Introduction

Build Status

slacksay

Convert slack messages to audible speech on Mac.

Install

go get github.com/ikawaha/slacksay/...

Usage

1. Get your slack token

see. https://api.slack.com/custom-integrations/legacy-tokens or https://api.slack.com/apps

2. Run slacksay

slacksay -t <slack_token> [-d (<json data>|@<file_name>|@-)]
  -d string
    	json data. If you start the data with the letter @, the rest should be a file name to read the data from, or -  if you  want to read the data from stdin.
  -t string
    	slack token

ex.

slacksay -t xoxp-your-token -d '{"bot_message": "true"}'

Configuration

note. If you do not specify anything for these options, the default values are used.

Option default Description Example
command say your speech tool(default say) say
channel::yomi --- specify the keyword reading ["random", "ザツダン"]
channel::includes --- target channels ["general", "develop"]
channel::excludes --- ignored channels ["random"]
user::yomi --- specify the user reading ["yamada", "ヤマダ"]
user::includes --- target users ["general", "develop"]
user::excludes --- ignored users ["random"]
keyword::yomi --- specify the keyword reading ["dev", "デブ"]
keyword::includes --- speak only messages that contain these keywords ["general", "develop"]
keyword::excludes --- ignore messages that contain these keywords ["random"]
bot_message false ignore bot message if false true
timeout 1m speech command timeout 3m10s

Example

{
  "command": "say",
  "channel": {
    "yomi": ["random", "ザツダン"],
    "includes": [],
    "excludes": ["bot-report"]
  },
  "user": {
    "yomi": ["yamada", "ヤマダ"],
    "includes": [],
    "excludes": ["my_slack_name"]
  },
  "keyword": {
    "yomi": ["dev", "開発環境"],
    "includes": ["レポート"],
    "excludes": ["info:"]
  },
  "bot_message": false,
  "timeout": "30s"
}

Ordr of Filtering

Options are specified, messages are filtered in the following order:

  1. channel
    1. includes ?
  2. user
    1. includes ?
  3. keyword (Convert a message to lowercase and apply filters to it.)
    1. includes ?
  4. bot_message ?
  5. channel
    1. excludes ?
  6. user
    1. excludes ?
  7. keyword (Convert a message to lowercase and apply filters to it.)
    1. excludes ?

MIT

slacksay's People

Contributors

ikawaha avatar utgwkk avatar

Stargazers

kimihiro_n avatar  avatar Yoshiteru Negishi avatar

Watchers

James Cloos avatar Koji.Takahashi avatar

Forkers

utgwkk pistatium

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.