DiscordLua
discorddiscord
v1.2.4
Install

GuildPreview

Class
On 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.

class Module 1.2.4 Source

Properties

GuildPreview.approximateMemberCount

# readonly
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.

GuildPreview.approximatePresenceCount

# readonly
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.

GuildPreview.client

# readonly
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.

GuildPreview.description

# readonly
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.

GuildPreview.discoverySplash

# readonly
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.

GuildPreview.emojis

# readonly
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

GuildPreview.features

# readonly
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.

GuildPreview.icon

# readonly
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.

GuildPreview.id

# readonly
Name
id
Type
any
Access
readonly
Description
Snowflake id of this GuildPreview.
Availability
Populated from the Gateway/REST payload or constructor for this GuildPreview.

GuildPreview.name

# readonly
Name
name
Type
any
Access
readonly
Description
Display name of this GuildPreview.
Availability
Populated from the Gateway/REST payload or constructor for this GuildPreview.

GuildPreview.raw

# readonly
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.

GuildPreview.splash

# readonly
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.

GuildPreview.stickers

# readonly
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

lua
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

lua
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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

GuildPreview — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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.

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc