Team
ClassOn this page
Team 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
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 Team.
- Name
icon- Type
any- Access
- readonly
- Description
- Instance field
Team.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 Team.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this Team.
- Availability
- Populated from the Gateway/REST payload or constructor for this Team.
- Name
members- Type
- Collection
- Access
- readonly
- Description
- Instance field
Team.members. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Team.
- Related
- Collection
- Name
name- Type
any- Access
- readonly
- Description
- Display name of this Team.
- Availability
- Populated from the Gateway/REST payload or constructor for this Team.
- Name
ownerId- Type
any- Access
- readonly
- Description
- Instance field
Team.ownerId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Team.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
Team.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 Team.
Methods
Team:createdAt()
#Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Team:createdAt() Parameters
No parameters.
Returns
Team — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Team
object:createdAt()Team:createdTimestamp()
#Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Team:createdTimestamp() Parameters
No parameters.
Returns
Team — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Team
object:createdTimestamp()Team:iconURL()
#Performs icon url on this Team. Call it from bot code when you need that operation on the current object.
Signature
Team: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
Team — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Team
object:iconURL({})Team:owner()
#Performs owner on this Team. Call it from bot code when you need that operation on the current object.
Signature
Team:owner() Parameters
No parameters.
Returns
Team — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Team
object:owner()Team:toString()
#function toString() { [native code] }
Signature
Team:toString() Parameters
No parameters.
Returns
Team — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Team
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