hubot-archive / hubot-business-cat Goto Github PK
View Code? Open in Web Editor NEWBusiness cat is summoned when business jargon is used
License: MIT License
Business cat is summoned when business jargon is used
License: MIT License
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?
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:
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>
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?
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.
So so sorry, i meant to open a Fork it and PR against it, and i hit commit instead.
Basically, i wanted to have "net-net" be a trigger.
I tried figuring out how to revert and it seems i cant. ๐ข
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.