GuildPreview
ClassOn this page
GuildPreview is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Properties
- Name
approximateMemberCount- Type
any- Access
- readonly
- Description
- Instance field
GuildPreview.approximateMemberCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
approximatePresenceCount- Type
any- Access
- readonly
- Description
- Instance field
GuildPreview.approximatePresenceCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
client- Type
any- Access
- readonly
- Description
- Owning Client instance used for REST, cache, and event dispatch.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
description- Type
any- Access
- readonly
- Description
- Instance field
GuildPreview.description. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
discoverySplash- Type
any- Access
- readonly
- Description
- Instance field
GuildPreview.discoverySplash. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
emojis- Type
- Collection
- Access
- readonly
- Description
- Instance field
GuildPreview.emojis. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Related
- Collection
- Name
features- Type
any- Access
- readonly
- Description
- Instance field
GuildPreview.features. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
icon- Type
any- Access
- readonly
- Description
- Instance field
GuildPreview.icon. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this GuildPreview.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
name- Type
any- Access
- readonly
- Description
- Display name of this GuildPreview.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
GuildPreview.raw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
splash- Type
any- Access
- readonly
- Description
- Instance field
GuildPreview.splash. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Name
stickers- Type
- Collection
- Access
- readonly
- Description
- Instance field
GuildPreview.stickers. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildPreview.
- Related
- Collection
Methods
GuildPreview:createdAt()
#Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
GuildPreview:createdAt() Parameters
No parameters.
Returns
GuildPreview — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildPreview
object:createdAt()GuildPreview:createdTimestamp()
#Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
GuildPreview:createdTimestamp() Parameters
No parameters.
Returns
GuildPreview — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildPreview
object:createdTimestamp()GuildPreview:discoverySplashURL()
#Performs discovery splash url on this GuildPreview. Call it from bot code when you need that operation on the current object.
Signature
GuildPreview:discoverySplashURL(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
GuildPreview — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildPreview
object:discoverySplashURL({})GuildPreview:fetch()
#Request a fresh copy of this resource from REST and update the cache.
Signature
GuildPreview:fetch(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildPreview — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildPreview
object:fetch(function(err, result)
if err then error(err) end
end)GuildPreview:iconURL()
#Performs icon url on this GuildPreview. Call it from bot code when you need that operation on the current object.
Signature
GuildPreview:iconURL(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
GuildPreview — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildPreview
object:iconURL({})GuildPreview:splashURL()
#Performs splash url on this GuildPreview. Call it from bot code when you need that operation on the current object.
Signature
GuildPreview:splashURL(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
GuildPreview — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildPreview
object:splashURL({})GuildPreview:toString()
#function toString() { [native code] }
Signature
GuildPreview:toString() Parameters
No parameters.
Returns
GuildPreview — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildPreview
object:toString()Examples
Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0