aido-emitters

1.0.1 • Public • Published

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")
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i aido-emitters

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

1.95 kB

Total Files

5

Last publish

Collaborators

  • dam-buty