RateLimitError
ErrorOn this page
RateLimitError is raised or passed to a REST callback when an operation fails. Read name and message; REST errors may also expose HTTP status and Discord error codes.
Constructor
RateLimitError.new(message, extra) The class table is callable, so RateLimitError(message, extra) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
message |
any |
required | Passed through to the implementation as written. |
extra |
any |
optional | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.RateLimitError({}, {})Properties
- Name
code- Type
number- Access
- readonly
- Description
- Instance field
RateLimitError.code. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this RateLimitError.
- Name
extra- Type
table- Access
- readonly
- Description
- Instance field
RateLimitError.extra. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this RateLimitError.
- Name
message- Type
string- Access
- readonly
- Description
- Instance field
RateLimitError.message. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this RateLimitError.
- Name
method- Type
string- Access
- readonly
- Description
- Instance field
RateLimitError.method. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this RateLimitError.
- Name
name- Type
string- Access
- readonly
- Description
- Display name of this RateLimitError.
- Availability
- Populated from the Gateway/REST payload or constructor for this RateLimitError.
- Name
path- Type
string- Access
- readonly
- Description
- Instance field
RateLimitError.path. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this RateLimitError.
- Name
retryAfter- Type
number- Access
- readonly
- Description
- Instance field
RateLimitError.retryAfter. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this RateLimitError.
- Name
status- Type
number- Access
- readonly
- Description
- Instance field
RateLimitError.status. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this RateLimitError.
Methods
Performs new on this RateLimitError. Call it from bot code when you need that operation on the current object.
Signature
RateLimitError.new(message, extra) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
message |
any |
required | Passed through to the implementation as written. |
extra |
any |
optional | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a RateLimitError
RateLimitError.new(message, extra)RateLimitError:raise()
#Performs raise on this RateLimitError. Call it from bot code when you need that operation on the current object.
Signature
RateLimitError:raise(level) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
level |
any |
required | Passed through to the implementation as written. |
Returns
any.
Throws
A DiscordLua error when arguments are invalid or the request fails without a callback.
Example
local discord = require("discord")
-- object is a RateLimitError
object:raise(level)Examples
local discord = require("discord")
local object = discord.RateLimitError({})Related APIs
APIError · AuthenticationError · DiscordLuaError · GatewayError · HTTPError · PermissionError · RuntimeError · ValidationError
Version: discord 1.2.4 · runtime 1.0.0