Skip to content

Commit

Permalink
fix: only specify ratelimit precision if required (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
dali546 committed Jan 16, 2021
1 parent d572a3e commit e17efe7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/discordrb/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def request(key, major_parameter, type, *attributes)
attributes.last[:user_agent] = user_agent if attributes.last.is_a? Hash

# Specify RateLimit precision
attributes.last[:x_ratelimit_precision] = 'millisecond'
attributes.last[:x_ratelimit_precision] = 'millisecond' if attributes.last.is_a?(Hash)

# The most recent Discord rate limit requirements require the support of major parameters, where a particular route
# and major parameter combination (*not* the HTTP method) uniquely identifies a RL bucket.
Expand Down

0 comments on commit e17efe7

Please sign in to comment.