@rowanmanning/get-all-messages-in-a-slack-channel
v5.2.3
Published
Get all messages in a public Slack channel
Downloads
60
Readme
@rowanmanning/get-all-messages-in-a-slack-channel
Get all messages in a public Slack channel.
Table of Contents
Requirements
This library requires the following to run:
- Node.js 18+
Usage
Install alongside the Slack web API with npm:
npm install @slack/web-api @rowanmanning/get-all-messages-in-a-slack-channel
Load the library into your code with a require
call (you'll also need the Slack WebClient
class):
const {WebClient} = require('@slack/web-api');
const getAllMessagesInASlackChannel = require('@rowanmanning/get-all-messages-in-a-slack-channel');
Get all the messages in a Slack channel:
const slackWebClient = new WebClient('YOUR-SLACK-TOKEN');
const messages = await getAllMessagesInASlackChannel(slackWebClient, 'YOUR-CHANNEL-ID');
See the Slack channels.history
response documentation for info on what the messages look like.
Contributing
The contributing guide is available here. All contributors must follow this library's code of conduct.
License
Licensed under the MIT license. Copyright © 2019, Rowan Manning