DiscordjsRangeError
ErrorOn this page
DiscordjsRangeError 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
DiscordjsRangeError.new(message, extra) The class table is callable, so DiscordjsRangeError(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.DiscordjsRangeError({}, {})Properties
- Name
code- Type
number- Access
- readonly
- Description
- Instance field
DiscordjsRangeError.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 DiscordjsRangeError.
- Name
extra- Type
table- Access
- readonly
- Description
- Instance field
DiscordjsRangeError.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 DiscordjsRangeError.
- Name
message- Type
string- Access
- readonly
- Description
- Instance field
DiscordjsRangeError.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 DiscordjsRangeError.
- Name
method- Type
string- Access
- readonly
- Description
- Instance field
DiscordjsRangeError.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 DiscordjsRangeError.
- Name
name- Type
string- Access
- readonly
- Description
- Display name of this DiscordjsRangeError.
- Availability
- Populated from the Gateway/REST payload or constructor for this DiscordjsRangeError.
- Name
path- Type
string- Access
- readonly
- Description
- Instance field
DiscordjsRangeError.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 DiscordjsRangeError.
- Name
retryAfter- Type
number- Access
- readonly
- Description
- Instance field
DiscordjsRangeError.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 DiscordjsRangeError.
- Name
status- Type
number- Access
- readonly
- Description
- Instance field
DiscordjsRangeError.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 DiscordjsRangeError.
Methods
Performs new on this DiscordjsRangeError. Call it from bot code when you need that operation on the current object.
Signature
DiscordjsRangeError.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 DiscordjsRangeError
DiscordjsRangeError.new(message, extra)DiscordjsRangeError:raise()
#Performs raise on this DiscordjsRangeError. Call it from bot code when you need that operation on the current object.
Signature
DiscordjsRangeError: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 DiscordjsRangeError
object:raise(level)Examples
local discord = require("discord")
local object = discord.DiscordjsRangeError({})Related APIs
AuthenticationError · DiscordAPIError · DiscordjsError · DiscordjsTypeError · DiscordLuaError · GatewayError · GatewayRateLimitError · HTTPError
Version: discord 1.2.9 · runtime 1.0.0