DiscordLua
discorddiscord
v1.2.4
Install

Sticker

Class
On this page

Sticker 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 REST Source

Properties

Sticker.available

# readonly
Name
available
Type
any
Access
readonly
Description
Instance field Sticker.available. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.

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

Sticker.description

# readonly
Name
description
Type
any
Access
readonly
Description
Instance field Sticker.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 Sticker.

Sticker.format

# readonly
Name
format
Type
any
Access
readonly
Description
Instance field Sticker.format. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.

Sticker.formatType

# readonly
Name
formatType
Type
any
Access
readonly
Description
Instance field Sticker.formatType. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.

Sticker.guildId

# readonly
Name
guildId
Type
any
Access
readonly
Description
Instance field Sticker.guildId. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.

Sticker.id

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

Sticker.name

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

Sticker.packId

# readonly
Name
packId
Type
any
Access
readonly
Description
Instance field Sticker.packId. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.

Sticker.partial

# readonly
Name
partial
Type
any
Access
readonly
Description
Instance field Sticker.partial. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.

Sticker.raw

# readonly
Name
raw
Type
any
Access
readonly
Description
Instance field Sticker.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 Sticker.

Sticker.sortValue

# readonly
Name
sortValue
Type
any
Access
readonly
Description
Instance field Sticker.sortValue. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.

Sticker.tags

# readonly
Name
tags
Type
any
Access
readonly
Description
Instance field Sticker.tags. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.

Sticker.type

# readonly
Name
type
Type
any
Access
readonly
Description
Instance field Sticker.type. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.

Sticker.user

# readonly
Name
user
Type
User
Access
readonly
Description
User object associated with this Sticker.
Availability
Populated from the Gateway/REST payload or constructor for this Sticker.
Related
User

Methods

Sticker:createdAt()

#

Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.

Signature

Sticker:createdAt()

Parameters

No parameters.

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:createdAt()

Sticker:createdTimestamp()

#

Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.

Signature

Sticker:createdTimestamp()

Parameters

No parameters.

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:createdTimestamp()

Sticker:delete()

#

Permanently delete this resource through REST.

Signature

Sticker:delete(callback)

Parameters

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

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:delete(function(err, result)
    if err then error(err) end
end)

Sticker:edit()

#

Apply a REST update to this resource.

Signature

Sticker:edit(options, callback)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:edit({}, function(err, result)
    if err then error(err) end
end)

Sticker:equals()

#

Return whether this Sticker refers to the same resource as the argument.

Signature

Sticker:equals(other)

Parameters

NameTypeRequiredBehavior
other any required Passed through to the implementation as written.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:equals(other)

Sticker:fetch()

#

Request a fresh copy of this resource from REST and update the cache.

Signature

Sticker:fetch(callback)

Parameters

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

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:fetch(function(err, result)
    if err then error(err) end
end)

Sticker:fetchPack()

#

Fetch Pack from REST and update the local cache when the request succeeds.

Signature

Sticker:fetchPack(callback)

Parameters

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

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:fetchPack(function(err, result)
    if err then error(err) end
end)

Sticker:fetchUser()

#

Fetch User from REST and update the local cache when the request succeeds.

Signature

Sticker:fetchUser(callback)

Parameters

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

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:fetchUser(function(err, result)
    if err then error(err) end
end)

Sticker:guild()

#

Performs guild on this Sticker. Call it from bot code when you need that operation on the current object.

Signature

Sticker:guild()

Parameters

No parameters.

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:guild()

Sticker:imageURL()

#

Performs image url on this Sticker. Call it from bot code when you need that operation on the current object.

Signature

Sticker:imageURL()

Parameters

No parameters.

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:imageURL()

Sticker:toJSON()

#

Serialize this Sticker into a Lua table suitable for REST or debugging.

Signature

Sticker:toJSON()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:toJSON()

Sticker:url()

#

Performs url on this Sticker. Call it from bot code when you need that operation on the current object.

Signature

Sticker:url()

Parameters

No parameters.

Returns

Sticker — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Sticker
object:url()

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