Created
September 12, 2020 09:30
-
-
Save hideack/a14f8c051575368ad4dcae025281fbbe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // 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