/cabal-bot-core

Create bots for cabal!

Primary LanguageJavaScriptGNU Affero General Public License v3.0AGPL-3.0

Cabal Bot Core

Basic functionality for cabal bots (https://cabal.chat/). For more advanced command parsing see cabal-bot-pipeline.

Getting Started

Installing

npm install cabal-bot-core

Examples

var CabalBot = require('cabal-bot')

const cb = new CabalBot('test-bot')

cb.on('new-command', (envelope, cabal) => {
  console.log('command entered!')
})

cb.on('new-message', (envelope, cabal) => {
  cabal.publishMessage({
    type: 'chat/text',
    content: {
      text: envelope.message.value.content.text,
      channel: envelope.channel
    }
  })
})

cb.joinCabal('{key}')