{"id":29289404,"url":"https://github.com/jamietsao/slack-multi-channel-invite","last_synced_at":"2025-10-12T10:40:13.042Z","repository":{"id":38394176,"uuid":"187771058","full_name":"jamietsao/slack-multi-channel-invite","owner":"jamietsao","description":"Script to invite a user to multiple Slack channels at once","archived":false,"fork":false,"pushed_at":"2022-02-10T17:19:21.000Z","size":28,"stargazers_count":25,"open_issues_count":4,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T04:09:24.505Z","etag":null,"topics":["golang","script","scripts","slack","slack-api","slack-channels","slackapi"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamietsao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-21T05:58:15.000Z","updated_at":"2023-10-25T12:11:34.000Z","dependencies_parsed_at":"2022-08-09T03:16:29.006Z","dependency_job_id":null,"html_url":"https://github.com/jamietsao/slack-multi-channel-invite","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jamietsao/slack-multi-channel-invite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamietsao%2Fslack-multi-channel-invite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamietsao%2Fslack-multi-channel-invite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamietsao%2Fslack-multi-channel-invite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamietsao%2Fslack-multi-channel-invite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamietsao","download_url":"https://codeload.github.com/jamietsao/slack-multi-channel-invite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamietsao%2Fslack-multi-channel-invite/sbom","scorecard":{"id":504621,"data":{"date":"2025-08-11","repo":{"name":"github.com/jamietsao/slack-multi-channel-invite","commit":"f3c93961d570431b18fd6907f1c7dd0652a958fa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.2.0 not signed: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/52390937","Warn: release artifact v1.1.0 not signed: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/44389335","Warn: release artifact v1.0.0 not signed: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/38024735","Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/36725184","Warn: release artifact v0.1.0 not signed: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/17549352","Warn: release artifact v1.2.0 does not have provenance: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/52390937","Warn: release artifact v1.1.0 does not have provenance: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/44389335","Warn: release artifact v1.0.0 does not have provenance: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/38024735","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/36725184","Warn: release artifact v0.1.0 does not have provenance: https://api.github.com/repos/jamietsao/slack-multi-channel-invite/releases/17549352"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T22:58:30.087Z","repository_id":38394176,"created_at":"2025-08-19T22:58:30.088Z","updated_at":"2025-08-19T22:58:30.088Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011058,"owners_count":26084865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","script","scripts","slack","slack-api","slack-channels","slackapi"],"created_at":"2025-07-06T04:09:06.347Z","updated_at":"2025-10-12T10:40:13.036Z","avatar_url":"https://github.com/jamietsao.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-multi-channel-invite\nHave you ever googled `\"slack invite user to multiple channels\"`?  Yeah, me too.  I do this every time a new engineer joins my team, and I inevitably end up inviting said engineer to each Slack channel manually.  I got tired of this, so I rolled up my sleeves and whipped up this script.\n\nI assume Slack will eventually add this ability.  Until then, hopefully you can save some time by using this.\n\nEnjoy!\n\n## Instructions\n1. [Create](https://api.slack.com/apps) a Slack App for your workspace.\n2. Add the following permission scopes to a user token (bot tokens aren't allowed `channels:write`):\n    - `users:read`\n    - `users:read.email`\n    - `channels:read`\n    - `channels:write`\n    - `groups:read` (only if inviting to private channels)\n    - `groups:write` (only if inviting to private channels)\n3. Install app to your workspace which will generate a new User OAuth token\n4. Download script:\n    - If you have Go installed: `go install github.com/jamietsao/slack-multi-channel-invite@latest`\n    - Else download the binary directly: https://github.com/jamietsao/slack-multi-channel-invite/releases\n5. Run script:\n\n`slack-multi-channel-invite -api_token=\u003cuser-oauth-token\u003e -emails=steph@warriors.com,klay@warriors.com -channels=dubnation,splashbrothers,thetown -private=\u003ctrue|false\u003e`\n\nThe users with emails `steph@warriors.com` and `klay@warriors.com` should be invited to channels `dubnation`, `splashbrothers`, and `thetown`!\n\n_* Set `private` flag to `true` if you want to invite users to private channels.  As noted above, this will require the additional permission scopes of `groups:read` and `groups:write`_\n\n#### Want to remove users from channels?\nSimply set the optional `action` flag to `remove` (`add` is the default):\n\n`slack-multi-channel-invite -api_token=\u003cuser-oauth-token\u003e -action=remove -emails=kd@warriors.com -channels=dubnation,warriors -private=\u003ctrue|false\u003e`\n\n\n## Implementation\nInitially, I figured this script would be a simple loop that invoked some API to invite users to a channel.  It turns out this API endpoint ([`conversations.invite`](https://api.slack.com/methods/conversations.invite)) expects the user ID (instead of username) and channel ID (instead of channel name).  Problem is, it's not very straightforward to get user and channel IDs. There isn't a way to lookup a user by username (only by email).  And there's no way to look up a single channel, unless you have the channel ID already (chicken and egg).\n\nFor these reasons, I wrote the script like so:\n1. [Look up](https://api.slack.com/methods/users.lookupByEmail) Slack user IDs for all given emails.\n2. [Query](https://api.slack.com/methods/conversations.list) all public (or private) channels in the workspace and create a name -\u003e ID mapping.\n3. For each of the given channels, [invite](https://api.slack.com/methods/conversations.invite) the users to the channel using the user IDs and channel ID from steps 1 \u0026 2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamietsao%2Fslack-multi-channel-invite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamietsao%2Fslack-multi-channel-invite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamietsao%2Fslack-multi-channel-invite/lists"}