Skip to content

Instantly share code, notes, and snippets.

@GrayedFox
Created April 23, 2019 08:58
Show Gist options
  • Save GrayedFox/9cc8a7115c115852160b0485b11ebfcd to your computer and use it in GitHub Desktop.
Save GrayedFox/9cc8a7115c115852160b0485b11ebfcd to your computer and use it in GitHub Desktop.
Get all Slack Member IDs of a Channel
// 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