Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

他の組織と共有されているPublicチャンネルを対象から除外する #13

Open
tamaq2048 opened this issue Aug 26, 2023 · 3 comments

Comments

@tamaq2048
Copy link
Owner

tamaq2048 commented Aug 26, 2023

channelsに含まれるis_ext_shared を用いて実装する

https://api.slack.com/methods/conversations.list

@tamaq2048 tamaq2048 changed the title 他のワークスペースに所属するPublicチャンネルを対象から除外する 他の組織に所属するPublicチャンネルを対象から除外する Aug 26, 2023
@tamaq2048
Copy link
Owner Author

例えば、is_shared が true で、is_ext_shared が false の場合、そのチャンネルはあなたのワークスペース内で共有されているが、他のワークスペースや組織とは共有されていない

@tamaq2048 tamaq2048 changed the title 他の組織に所属するPublicチャンネルを対象から除外する 他の組織にと共有されているPublicチャンネルを対象から除外する Aug 26, 2023
@tamaq2048 tamaq2048 changed the title 他の組織にと共有されているPublicチャンネルを対象から除外する 他の組織と共有されているPublicチャンネルを対象から除外する Aug 26, 2023
@tamaq2048
Copy link
Owner Author

is_ext_sharedを使って実装

@tamaq2048
Copy link
Owner Author

Slack APIの conversations.list メソッドを使って取得したチャンネル情報には、そのチャンネルが他の組織やワークスペースと共有されているかどうかを示すフラグが含まれます。具体的には、is_ext_shared と is_org_shared のフラグです。

自分の組織に所属するPublicチャンネルを識別するためには、以下の条件を満たすチャンネルを選びます。

is_channel が true である。
is_archived が false である。
is_ext_shared が false である。
is_org_shared が false である。
これらの条件を満たすチャンネルは、自分の組織に所属し、アクティブで、他の組織やワークスペースと共有されていないPublicチャンネルです。

したがって、チャンネル情報を取得する際に、これらの条件を満たすチャンネルだけを選択するようにフィルタリングを行うことで、自分の組織に所属するPublicチャンネルを識別できます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant