Created
April 23, 2019 08:58
-
-
Save GrayedFox/9cc8a7115c115852160b0485b11ebfcd to your computer and use it in GitHub Desktop.
Get all Slack Member IDs of a Channel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Open up the desired channel in the Slack web interface and run the following to generate display name/id pairs | |
const channelMembers = members = document.querySelectorAll('#channel_page_all_members div a') | |
const idNamePairs = {} | |
members.forEach( (div) => { | |
const name = div.children[2].firstElementChild.innerHTML | |
idNamePairs[name] = div.getAttribute('data-member-id') | |
}) | |
console.log(idNamePairs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment