npm.io
0.2.0 • Published 8 years ago

slack-remove-formatting

Licence
Unlicense
Version
0.2.0
Deps
0
Size
4 kB
Vulns
0
Weekly
0

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

Keywords