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

fetch all channels #48

Merged
merged 3 commits into from
Apr 29, 2023
Merged

fetch all channels #48

merged 3 commits into from
Apr 29, 2023

Conversation

cookie-s
Copy link
Member

Resolve #47

conversations.listのlimit defaultが、100だったらしいっす

Copy link
Member

なーるほど

Comment on lines +28 to +32
channels = []
client.conversations_list({type: 'public_channel', limit: 1000}) do |response|
channels += response.channels
end
channels
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -85,12 +83,10 @@ def start(collector)
update_users
update_channels

Channels.find.each do |c|
puts "loading messages from #{c[:name]}"
if c[:is_channel]
Copy link
Member Author

@cookie-s cookie-s Apr 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このifだいぶわかんなかった

https://api.slack.com/types/conversation

is_channel indicates whether a conversation is a channel. Private channels created before March 2021 (with IDs that begin with G) will return false, and is_group will be true instead. Use is_private to determine whether a channel is private or public.

これかなぁ

@cookie-s cookie-s merged commit f3dbade into master Apr 29, 2023
@cookie-s cookie-s deleted the update-channels-all branch April 29, 2023 03:37
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

Successfully merging this pull request may close these issues.

新しいチャンネル、チャンネル一覧に表示されてないがち
2 participants