Giter Site home page Giter Site logo

hubot-business-cat's Issues

Add the ability to remove phrases as well as add

Hi, Love the plugin โค๏ธ๐Ÿˆ

There are a few phrases that we like "ping me" that don't feel very corporate, maybe we can also have a way to remove or replace the list of phases as well as just adding? I can work on a PR for this.

Word separation

Just had a rather unusual incident where someone, whose name contained the word "guru" (amongst many other letters) was mentioned in a room and business cat was summoned.

Could this plugin search for actual separated words?

jargon could end up undefined

https://github.com/hubot-scripts/hubot-business-cat/blob/master/src/businesscat.coffee#L27

In removeTerm(), if a term is not found, it returns undefined due to the return being nested inside of the if [found]. Thus, if the last term in omittedJargon is not found, jargon will be set to undefined.

Possible fixes:

  • I think reducing the indent on the return will fix this.
  • Don't return anything and remove the jargon = from the omit line. removeTerm alters the incoming list.

Problem:

coffee> jargon = [1..5]
[ 1, 2, 3, 4, 5 ]
coffee> jargon = removeTerm(term, jargon) for term in [3, 99]
[ [ 1, 2, 4, 5 ], undefined ]
coffee> jargon
undefined

Possible solution 1:

------> removeTerm = (term, arrayToDeleteFrom) ->
.......   index = arrayToDeleteFrom.indexOf term
.......   if index > -1
.......     arrayToDeleteFrom.splice index, 1
.......   return arrayToDeleteFrom
[Function: removeTerm]
coffee> jargon = [1..5]
[ 1, 2, 3, 4, 5 ]
coffee> jargon = removeTerm(term, jargon) for term in [3, 99]
[ [ 1, 2, 4, 5 ], [ 1, 2, 4, 5 ] ]
coffee> jargon
[ 1, 2, 4, 5 ]
coffee>

Possible solution 2:

coffee> jargon = [1..5]
[ 1, 2, 3, 4, 5 ]
coffee> removeTerm(term, jargon) for term in [3, 99]
[ [ 1, 2, 4, 5 ], undefined ]
coffee> jargon
[ 1, 2, 4, 5 ]
coffee>

Triggers on non-listed words

We're using this tool-of-high-productivity in Slack, but we're getting triggers against variations of the word "droid". As you can imagine it also picks up all "Android" references.

I don't see that in the trigger list. Any ideas?

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.