0.2.0 • Published 6 years ago

slack-remove-formatting v0.2.0

Weekly downloads
3
License
Unlicense
Repository
github
Last release
6 years ago

Remove Slack message formatting npm version

Library version of this code.

Usage

const slack = require('@slack/client')
const makeRemoveFormatting = require('slack-remove-formatting')

const rtm = new slack.RtmClient(config.token)

rtm.on(slack.CLIENT_EVENTS.RTM.AUTHENTICATED, state => {
  const removeFormatting = makeRemoveFormatting(state)

  rtm.on(slack.RTM_EVENTS.MESSAGE, message => {
    const text = removeFormatting(message.text)
    console.log(text)
  })
})