Comparing version 0.1.0 to 0.1.1
@@ -120,2 +120,6 @@ 'use strict'; | ||
} | ||
if ('*' in listeners) { | ||
self._sendMessage(msg, '*', msg.text); | ||
} | ||
}; | ||
@@ -131,2 +135,3 @@ } | ||
'parse': 'full', | ||
'link_names': 1, | ||
'text': attachment.text ? attachment.text : null, | ||
@@ -165,2 +170,4 @@ 'attachments': attachment.attachments | ||
} | ||
return; | ||
} | ||
@@ -173,3 +180,9 @@ }]); | ||
function ghee(target, key) { | ||
listeners[key] = key; | ||
if (!key) { | ||
return function (_target, _key) { | ||
listeners[target] = _key; | ||
}; | ||
} else { | ||
listeners[key] = key; | ||
} | ||
} | ||
@@ -176,0 +189,0 @@ |
{ | ||
"name": "ghee", | ||
"version": "0.1.0", | ||
"description": "ES7 Slack Bot Wrapper", | ||
"version": "0.1.1", | ||
"description": "ES2016+ Slack Bot Framework", | ||
"main": "lib/ghee.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -37,4 +37,9 @@ # ghee [![npm version](https://badge.fury.io/js/ghee.svg)](https://badge.fury.io/js/ghee) [![Build Status](https://travis-ci.org/elliottcarlson/ghee.svg?branch=master)](https://travis-ci.org/elliottcarlson/ghee) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/5c43cf385708406f9b1f112771314b89)](https://www.codacy.com/app/trendinteractive/ghee?utm_source=github.com&utm_medium=referral&utm_content=elliottcarlson/ghee&utm_campaign=Badge_Grade) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/5c43cf385708406f9b1f112771314b89)](https://www.codacy.com/app/trendinteractive/ghee?utm_source=github.com&utm_medium=referral&utm_content=elliottcarlson/ghee&utm_campaign=Badge_Coverage) | ||
provides all the files and references needed to quickly get setup to create | ||
your own bot. | ||
your own bot. | ||
The ghee helper function will either register the method being decorated | ||
directly, or can be passed a parameter to register as the string to respond to. | ||
An special parameter of `*` will cause that method to receive all content and | ||
acts as a catch-all method. | ||
A straight-forward bot that will respond to `.hello` and `.goodbye` messages in | ||
@@ -55,4 +60,4 @@ Slack would look like: | ||
@ghee | ||
goodbye() { | ||
@ghee('goodbye') | ||
other_method() { | ||
return 'Goodbye!'; | ||
@@ -59,0 +64,0 @@ } |
@@ -309,2 +309,3 @@ import chai from 'chai'; | ||
'as_user': true, | ||
'link_names': 1, | ||
'parse': 'full', | ||
@@ -311,0 +312,0 @@ 'text': (attachment.text) ? attachment.text : null, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
46078
1127
151
0