Skip to content

Instantly share code, notes, and snippets.

@kewitz
Last active February 9, 2018 23:17
Show Gist options
  • Save kewitz/926b856efc75cc611f067fae5453cd14 to your computer and use it in GitHub Desktop.
Save kewitz/926b856efc75cc611f067fae5453cd14 to your computer and use it in GitHub Desktop.
Importing channels in Slack
const channelCodes = [...document.querySelectorAll('#channels_list optgroup option')].reduce((acc, n) => {
acc[n.innerText] = n.value
return acc
}, {})
TS.boot_data.all_channels.forEach(channel => {
if(channelCodes[`#${channel.name}`]) channel.mapping = channelCodes[`#${channel.name}`]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment