Closed rohitbordia closed 3 years ago
Slack API doesn't actually support channel-name
, so this happens because the client tries to resolve channel-name
for you, see https://github.com/slack-ruby/slack-ruby-client#get-channel-info. Replace the channel name with a channel ID to fix this.
The implementation is https://github.com/slack-ruby/slack-ruby-client/blob/master/lib/slack/web/api/mixins/ids.id.rb FYI.
Hello, We recently upgraded to started using the
0.16.0
version and we are being rate limited when using the chat_update method. Further investigating with the Slack support team we found that even though we are calling the chat_update API method it internally calls theconversations.list
method which is throwing HTTPTooManyRequest errors. We contacted the Slack support team and found we made ~150 requests onchat_update
method.Stack trace: /usr/local/bundle/gems/resque-2.0.0/lib/resque/worker.rb:412:in
block in unregister_signal_handlers' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/pagination/cursor.rb:35:in
sleep' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/pagination/cursor.rb:35:inrescue in block in each' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/pagination/cursor.rb:28:in
block in each' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/pagination/cursor.rb:26:inloop' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/pagination/cursor.rb:26:in
each' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/api/endpoints/conversations.rb:173:inconversations_list' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/api/mixins/ids.id.rb:12:in
public_send' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/api/mixins/ids.id.rb:12:inid_for' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/api/mixins/conversations.id.rb:19:in
conversations_id' /usr/local/bundle/gems/slack-ruby-client-0.16.0/lib/slack/web/api/endpoints/chat.rb:282:in `chat_update'Usage:
slack_client.chat_update( channel: "channel-name", text: "test", ts: "1620689145.394500", attachments: nil, as_user: true )