slack-entities

1.0.0 • Public • Published

slack-entities

Methods for extracting entities like channels and users from Slack messages.

Example:

const slackEntities = require('../')
const getChannels = slackEntities.getChannels
const getUsers = slackEntities.getUsers
const getGroups = slackEntities.getGroups
const getFiles = slackEntities.getFiles

getChannels('hey <@USLACKBOT> check out <#C0000000>')
// [{
//   tag: '<#C0000000>',
//   id: 'C0000000'
// }]
getUsers('i bet <@USLACKBOT> knows <HTML/>')
// [{
//   tag: '<@USLACKBOT>',
//   id: 'USLACKBOT'
// }]
getGroups('lylas <!subteam^S0000000|@besties>')
// [{
//   tag: '<!subteam^S0000000|@besties>',
//   id: 'S0000000'
// }]
getFiles('check out <https://austinprivatelibrary.slack.com/files/flip/F00000000/README.md> and <https://get.slack.help/hc/en-us/articles/204399343-Sharing-links-in-Slack>')
// [{
//   tag: '<https://austinprivatelibrary.slack.com/files/flip/F00000000/README.md>',
//   id: 'https://austinprivatelibrary.slack.com/files/flip/F00000000/README.md',
// }]

Readme

Keywords

none

Package Sidebar

Install

npm i slack-entities

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • flipactual