Sha256: 4d566941e6ddacb7678ce4436c1944e10d1b45834bf7b20e51f8042e2e36f73d
Contents?: true
Size: 659 Bytes
Versions: 4
Compression:
Stored size: 659 Bytes
Contents
module SlackBotManager module Commands # Handle when connection gets closed def on_close(data, *args) options = args.extract_options! options[:code] ||= (data && data.code) || '1000' disconnect fail SlackBotManager::ConnectionRateLimited if %w(1008 429).include?(options[:code].to_s) end # Handle rate limit errors coming from web API def on_revoke(*) disconnect(:token_revoked) fail SlackBotManager::TokenRevoked end # Handle rate limit errors coming from web API def on_rate_limit(*) disconnect(:rate_limited) fail SlackBotManager::ConnectionRateLimited end end end
Version data entries
4 entries across 4 versions & 1 rubygems