aido-emitters
v1.0.1
Published
A plugin to make Slash and Action emitters accessible to Aido applications
Downloads
1
Readme
aido-emitters
Aido emitters is a simple plugin that exposes the emitSlash
and emitAction
functions on the Slash class.
Installation
The aido-emitters package can be installed with your package manager of choice :
npm install --save aido-emitters
# or
yarn add aido-emitters
To use it in your Aido application, you'll need to import it as a plugin :
const aidoEmitters = require('aido-emitters')
aido.init({
plugins: [aidoEmitters],
})
Usage
class MySlash extends Slash {
myMethod() {
// Emit a Slash (this is the equivalent of the user typing "/fnord some text" in Slack)
this.emitSlash(this.user.slackId, "fnord", "some text")
}
otherMethod() {
// Emit an action (this is the equivalent of the user clicking a button or submitting a dialog on your "fnord" view)
this.emitAction(this.user.slackId, "fnord", "myMethod")
}
}