cabal-bot-core

1.0.10 • Public • Published

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

/cabal-bot-core/

    Package Sidebar

    Install

    npm i cabal-bot-core

    Weekly Downloads

    17

    Version

    1.0.10

    License

    AGPL-3.0

    Unpacked Size

    43.5 kB

    Total Files

    6

    Last publish

    Collaborators

    • timgoeller