Skip to content

Instantly share code, notes, and snippets.

@hideack
Created September 12, 2020 09:30
Show Gist options
  • Select an option

  • Save hideack/a14f8c051575368ad4dcae025281fbbe to your computer and use it in GitHub Desktop.

Select an option

Save hideack/a14f8c051575368ad4dcae025281fbbe to your computer and use it in GitHub Desktop.
// Setup
const {WebClient} = require("@slack/client");
const web = new WebClient(token, {logLevel: "error"});
web.users.list().then((response) => {
response.members.forEach((v, i) => {
// Slackの参加者にまつわる諸々
});
return web.channels.list();
}).then((response) => {
response.channels.forEach((v, i) => {
// パブリックチャンネルにまつわる諸々
});
return web.groups.list();
}).then((response) => {
response.groups.forEach((v, i) => {
// プライベートチャンネルにまつわる諸々
});
}).then(() => {
// すべて完了
}).catch((error) => {
console.log(error);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment