Hands-on: Slack
const token = 'xoxb-....' const Api = require('@slack/client').WebClient const api = new Api(token) const RtmClient = require('@slack/client').RtmClient const rtm = new RtmClient(token) const RTM_EVENTS = require('@slack/client').RTM_EVENTS api.channels.list(function (err, info) { const channelId = info.channels .filter((channel) => channel.name === 'general') .map((channel) => channel.id)[0] rtm.on(RTM_EVENTS.MESSAGE, (msg) => { rtm.sendMessage(msg.text, channelId) }) rtm.start() })