DiscordLua
discorddiscord
v1.2.4
Install

Guild

Class
On this page

Guild represents a Discord server the bot can see. Use it to reach channels, members, roles, and guild-scoped REST helpers such as :createChannel.

class Module 1.2.4 Source

Properties

Guild.afkChannelId

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

Guild.afkTimeout

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

Guild.applicationId

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

Guild.approximateMemberCount

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

Guild.approximatePresenceCount

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

Guild.autoModerationRules

# readonly
Name
autoModerationRules
Type
AutoModerationRuleManager
Access
readonly
Description
Cache and REST facade for automoderationrule objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
AutoModerationRuleManager

Guild.available

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

Guild.banner

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

Guild.bans

# readonly
Name
bans
Type
GuildBanManager
Access
readonly
Description
Cache and REST facade for guildban objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
GuildBanManager

Guild.channels

# readonly
Name
channels
Type
ChannelManager
Access
readonly
Description
Cache and REST facade for channel objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
ChannelManager

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

Guild.commands

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

Guild.defaultMessageNotifications

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

Guild.description

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

Guild.discoverySplash

# mutable
Name
discoverySplash
Type
any
Access
mutable
Description
Instance field Guild.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 Guild.

Guild.emojis

# readonly
Name
emojis
Type
BaseGuildEmojiManager
Access
readonly
Description
Cache and REST facade for baseguildemoji objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
BaseGuildEmojiManager

Guild.explicitContentFilter

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

Guild.features

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

Guild.icon

# mutable
Name
icon
Type
any
Access
mutable
Description
Instance field Guild.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 Guild.

Guild.id

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

Guild.incidentsData

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

Guild.invites

# readonly
Name
invites
Type
GuildInviteManager
Access
readonly
Description
Cache and REST facade for guildinvite objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
GuildInviteManager

Guild.joinedAt

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

Guild.joinedTimestamp

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

Guild.large

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

Guild.maxMembers

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

Guild.maxPresences

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

Guild.maxStageVideoChannelUsers

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

Guild.maxVideoChannelUsers

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

Guild.maximumMembers

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

Guild.maximumPresences

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

Guild.memberCount

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

Guild.members

# readonly
Name
members
Type
GuildMemberManager
Access
readonly
Description
Cache and REST facade for guildmember objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
GuildMemberManager

Guild.mfaLevel

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

Guild.name

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

Guild.nsfwLevel

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

Guild.owner

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

Guild.ownerId

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

Guild.permissions

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

Guild.preferredLocale

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

Guild.premiumProgressBarEnabled

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

Guild.premiumSubscriptionCount

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

Guild.premiumTier

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

Guild.presences

# readonly
Name
presences
Type
PresenceManager
Access
readonly
Description
Cache and REST facade for presence objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
PresenceManager

Guild.publicUpdatesChannelId

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

Guild.raw

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

Guild.roles

# readonly
Name
roles
Type
RoleManager
Access
readonly
Description
Cache and REST facade for role objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
RoleManager

Guild.rulesChannelId

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

Guild.safetyAlertsChannelId

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

Guild.scheduledEvents

# readonly
Name
scheduledEvents
Type
GuildScheduledEventManager
Access
readonly
Description
Cache and REST facade for guildscheduledevent objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
GuildScheduledEventManager

Guild.soundboardSounds

# readonly
Name
soundboardSounds
Type
GuildSoundboardSoundManager
Access
readonly
Description
Cache and REST facade for guildsoundboardsound objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
GuildSoundboardSoundManager

Guild.splash

# mutable
Name
splash
Type
any
Access
mutable
Description
Instance field Guild.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 Guild.

Guild.stageInstances

# readonly
Name
stageInstances
Type
StageInstanceManager
Access
readonly
Description
Cache and REST facade for stageinstance objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
StageInstanceManager

Guild.stickers

# readonly
Name
stickers
Type
GuildStickerManager
Access
readonly
Description
Cache and REST facade for guildsticker objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
GuildStickerManager

Guild.systemChannelFlags

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

Guild.systemChannelId

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

Guild.unavailable

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

Guild.vanityURLCode

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

Guild.vanityURLUses

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

Guild.verificationLevel

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

Guild.voiceStates

# readonly
Name
voiceStates
Type
VoiceStateManager
Access
readonly
Description
Cache and REST facade for voicestate objects owned by this Guild. Use it to fetch, create, resolve, and mutate those resources.
Availability
Created in Guild.new and remains valid for the lifetime of the Guild.
Related
VoiceStateManager

Guild.welcomeScreen

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

Guild.widgetChannelId

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

Guild.widgetEnabled

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

Methods

Guild:afkChannel()

#

Performs afk channel on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:afkChannel()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:afkChannel()

Guild:ban()

#

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

Signature

Guild:ban(userId, options, callback)

Parameters

NameTypeRequiredBehavior
userId string required Snowflake id string.
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

Guild — the same instance, for chaining.

Example

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

Guild:bannerURL()

#

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

Signature

Guild:bannerURL(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:bannerURL({})

Guild:bulkBan()

#

Performs bulk ban on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:bulkBan(userIds, options, callback)

Parameters

NameTypeRequiredBehavior
userIds any required Passed through to the implementation as written.
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

Guild — the same instance, for chaining.

Example

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

Guild:createAutoModerationRule()

#

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

Signature

Guild:createAutoModerationRule(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

Guild — the same instance, for chaining.

Example

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

Guild:createChannel()

#

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

Signature

Guild:createChannel(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

Guild — the same instance, for chaining.

Example

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

Guild:createdAt()

#

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

Signature

Guild:createdAt()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

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

Guild:createdTimestamp()

#

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

Signature

Guild:createdTimestamp()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

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

Guild:createEmoji()

#

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

Signature

Guild:createEmoji(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

Guild — the same instance, for chaining.

Example

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

Guild:createInvite()

#

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

Signature

Guild:createInvite(channelId, options, callback)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.
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

Guild — the same instance, for chaining.

Example

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

Guild:createScheduledEvent()

#

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

Signature

Guild:createScheduledEvent(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

Guild — the same instance, for chaining.

Example

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

Guild:createSoundboardSound()

#

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

Signature

Guild:createSoundboardSound(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

Guild — the same instance, for chaining.

Example

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

Guild:createSticker()

#

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

Signature

Guild:createSticker(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

Guild — the same instance, for chaining.

Example

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

Guild:createTemplate()

#

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

Signature

Guild:createTemplate(name, description)

Parameters

NameTypeRequiredBehavior
name any required Passed through to the implementation as written.
description any required Passed through to the implementation as written.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:createTemplate(name, description)

Guild:delete()

#

Permanently delete this resource through REST.

Signature

Guild:delete(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:disableInvites()

#

Performs disable invites on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:disableInvites(disabled)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:disableInvites(disabled)

Guild:discoverySplashURL()

#

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

Signature

Guild:discoverySplashURL(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:discoverySplashURL({})

Guild:edit()

#

Apply a REST update to this resource.

Signature

Guild:edit(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:edit({})

Guild:editOnboarding()

#

Apply a REST update to Onboarding and refresh the local object when the request succeeds.

Signature

Guild:editOnboarding(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:editOnboarding({})

Guild:editWelcomeScreen()

#

Apply a REST update to WelcomeScreen and refresh the local object when the request succeeds.

Signature

Guild:editWelcomeScreen(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:editWelcomeScreen({})

Guild:equals()

#

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

Signature

Guild: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 Guild
object:equals(other)

Guild:fetch()

#

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

Signature

Guild:fetch(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchAuditLogs()

#

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

Signature

Guild:fetchAuditLogs(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

Guild — the same instance, for chaining.

Example

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

Guild:fetchAutoModerationRules()

#

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

Signature

Guild:fetchAutoModerationRules(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchBan()

#

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

Signature

Guild:fetchBan(userId, callback)

Parameters

NameTypeRequiredBehavior
userId string required Snowflake id string.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchBans()

#

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

Signature

Guild:fetchBans(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchChannels()

#

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

Signature

Guild:fetchChannels(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchEmojis()

#

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

Signature

Guild:fetchEmojis(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchIntegrations()

#

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

Signature

Guild:fetchIntegrations(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchInvites()

#

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

Signature

Guild:fetchInvites(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchMe()

#

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

Signature

Guild:fetchMe(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchMember()

#

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

Signature

Guild:fetchMember(userId, callback)

Parameters

NameTypeRequiredBehavior
userId string required Snowflake id string.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchMembers()

#

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

Signature

Guild:fetchMembers(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

Guild — the same instance, for chaining.

Example

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

Guild:fetchOnboarding()

#

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

Signature

Guild:fetchOnboarding(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchOwner()

#

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

Signature

Guild:fetchOwner(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchPreview()

#

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

Signature

Guild:fetchPreview(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchScheduledEvents()

#

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

Signature

Guild:fetchScheduledEvents(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchSoundboardSounds()

#

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

Signature

Guild:fetchSoundboardSounds(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchStickers()

#

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

Signature

Guild:fetchStickers(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchTemplates()

#

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

Signature

Guild:fetchTemplates(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchVanityData()

#

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

Signature

Guild:fetchVanityData(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchWebhooks()

#

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

Signature

Guild:fetchWebhooks(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchWelcomeScreen()

#

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

Signature

Guild:fetchWelcomeScreen(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchWidget()

#

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

Signature

Guild:fetchWidget(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:fetchWidgetSettings()

#

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

Signature

Guild:fetchWidgetSettings(callback)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

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

Guild:iconURL()

#

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

Signature

Guild:iconURL(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:iconURL({})

Guild:kick()

#

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

Signature

Guild:kick(userId, reason, callback)

Parameters

NameTypeRequiredBehavior
userId string required Snowflake id string.
reason string optional Audit-log reason sent as X-Audit-Log-Reason on REST mutations.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:kick("123", reason, function(err, result)
    if err then error(err) end
end)

Guild:leave()

#

Leave the associated voice connection.

Signature

Guild:leave()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:leave()

Guild:maximumBitrate()

#

Performs maximum bitrate on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:maximumBitrate()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Guild
object:maximumBitrate()

Guild:maximumStageBitrate()

#

Performs maximum stage bitrate on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:maximumStageBitrate()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Guild
object:maximumStageBitrate()

Guild:me()

#

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

Signature

Guild:me()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:me()

Guild:nameAcronym()

#

Performs name acronym on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:nameAcronym()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:nameAcronym()

Guild:partnered()

#

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

Signature

Guild:partnered()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:partnered()

Guild:publicUpdatesChannel()

#

Performs public updates channel on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:publicUpdatesChannel()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:publicUpdatesChannel()

Guild:removeTimeout()

#

Remove Timeout from this Guild.

Signature

Guild:removeTimeout(userId, reason, callback)

Parameters

NameTypeRequiredBehavior
userId string required Snowflake id string.
reason string optional Audit-log reason sent as X-Audit-Log-Reason on REST mutations.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:removeTimeout("123", reason, function(err, result)
    if err then error(err) end
end)

Guild:rulesChannel()

#

Performs rules channel on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:rulesChannel()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:rulesChannel()

Guild:safetyAlertsChannel()

#

Performs safety alerts channel on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:safetyAlertsChannel()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:safetyAlertsChannel()

Guild:setAFKChannel()

#

Set the AFKChannel field. Builders return this Guild so setters can be chained.

Signature

Guild:setAFKChannel(channelId)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setAFKChannel("123")

Guild:setAFKTimeout()

#

Set the AFKTimeout field. Builders return this Guild so setters can be chained.

Signature

Guild:setAFKTimeout(timeout)

Parameters

NameTypeRequiredBehavior
timeout number required Duration in milliseconds.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setAFKTimeout(timeout)

Guild:setBanner()

#

Set the Banner field. Builders return this Guild so setters can be chained.

Signature

Guild:setBanner(banner)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setBanner(banner)

Guild:setDefaultMessageNotifications()

#

Set the DefaultMessageNotifications field. Builders return this Guild so setters can be chained.

Signature

Guild:setDefaultMessageNotifications(value)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setDefaultMessageNotifications(value)

Guild:setDiscoverySplash()

#

Set the DiscoverySplash field. Builders return this Guild so setters can be chained.

Signature

Guild:setDiscoverySplash(splash)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setDiscoverySplash(splash)

Guild:setExplicitContentFilter()

#

Set the ExplicitContentFilter field. Builders return this Guild so setters can be chained.

Signature

Guild:setExplicitContentFilter(value)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setExplicitContentFilter(value)

Guild:setIcon()

#

Set the Icon field. Builders return this Guild so setters can be chained.

Signature

Guild:setIcon(icon)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setIcon(icon)

Guild:setIncidentActions()

#

Set the IncidentActions field. Builders return this Guild so setters can be chained.

Signature

Guild:setIncidentActions(actions)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setIncidentActions(actions)

Guild:setMFALevel()

#

Set the MFALevel field. Builders return this Guild so setters can be chained.

Signature

Guild:setMFALevel(level)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setMFALevel(level)

Guild:setName()

#

Set the Name field. Builders return this Guild so setters can be chained.

Signature

Guild:setName(name)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setName(name)

Guild:setNickname()

#

Set the Nickname field. Builders return this Guild so setters can be chained.

Signature

Guild:setNickname(userId, nick, reason, callback)

Parameters

NameTypeRequiredBehavior
userId string required Snowflake id string.
nick any required Passed through to the implementation as written.
reason string optional Audit-log reason sent as X-Audit-Log-Reason on REST mutations.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setNickname("123", nick, reason, function(err, result)
    if err then error(err) end
end)

Guild:setOwner()

#

Set the Owner field. Builders return this Guild so setters can be chained.

Signature

Guild:setOwner(userId)

Parameters

NameTypeRequiredBehavior
userId string required Snowflake id string.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setOwner("123")

Guild:setPreferredLocale()

#

Set the PreferredLocale field. Builders return this Guild so setters can be chained.

Signature

Guild:setPreferredLocale(locale)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setPreferredLocale(locale)

Guild:setPremiumProgressBarEnabled()

#

Set the PremiumProgressBarEnabled field. Builders return this Guild so setters can be chained.

Signature

Guild:setPremiumProgressBarEnabled(enabled)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setPremiumProgressBarEnabled(enabled)

Guild:setPublicUpdatesChannel()

#

Set the PublicUpdatesChannel field. Builders return this Guild so setters can be chained.

Signature

Guild:setPublicUpdatesChannel(channelId)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setPublicUpdatesChannel("123")

Guild:setRulesChannel()

#

Set the RulesChannel field. Builders return this Guild so setters can be chained.

Signature

Guild:setRulesChannel(channelId)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setRulesChannel("123")

Guild:setSafetyAlertsChannel()

#

Set the SafetyAlertsChannel field. Builders return this Guild so setters can be chained.

Signature

Guild:setSafetyAlertsChannel(channelId)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setSafetyAlertsChannel("123")

Guild:setSplash()

#

Set the Splash field. Builders return this Guild so setters can be chained.

Signature

Guild:setSplash(splash)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setSplash(splash)

Guild:setSystemChannel()

#

Set the SystemChannel field. Builders return this Guild so setters can be chained.

Signature

Guild:setSystemChannel(channelId)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setSystemChannel("123")

Guild:setSystemChannelFlags()

#

Set the SystemChannelFlags field. Builders return this Guild so setters can be chained.

Signature

Guild:setSystemChannelFlags(flags)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setSystemChannelFlags(flags)

Guild:setVerificationLevel()

#

Set the VerificationLevel field. Builders return this Guild so setters can be chained.

Signature

Guild:setVerificationLevel(level)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setVerificationLevel(level)

Guild:setWidgetSettings()

#

Set the WidgetSettings field. Builders return this Guild so setters can be chained.

Signature

Guild:setWidgetSettings(settings)

Parameters

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

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:setWidgetSettings(settings)

Guild:shard()

#

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

Signature

Guild:shard()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:shard()

Guild:shardId()

#

Performs shard id on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:shardId()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:shardId()

Guild:splashURL()

#

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

Signature

Guild:splashURL(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:splashURL({})

Guild:systemChannel()

#

Performs system channel on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:systemChannel()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:systemChannel()

Guild:timeout()

#

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

Signature

Guild:timeout(userId, duration, reason, callback)

Parameters

NameTypeRequiredBehavior
userId string required Snowflake id string.
duration any required Passed through to the implementation as written.
reason string optional Audit-log reason sent as X-Audit-Log-Reason on REST mutations.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:timeout("123", duration, reason, function(err, result)
    if err then error(err) end
end)

Guild:toJSON()

#

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

Signature

Guild:toJSON()

Parameters

No parameters.

Returns

any.

Example

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

Guild:toString()

#

function toString() { [native code] }

Signature

Guild:toString()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:toString()

Guild:unban()

#

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

Signature

Guild:unban(userId, reason, callback)

Parameters

NameTypeRequiredBehavior
userId string required Snowflake id string.
reason string optional Audit-log reason sent as X-Audit-Log-Reason on REST mutations.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:unban("123", reason, function(err, result)
    if err then error(err) end
end)

Guild:verified()

#

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

Signature

Guild:verified()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:verified()

Guild:voiceAdapterCreator()

#

Performs voice adapter creator on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:voiceAdapterCreator()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Guild
object:voiceAdapterCreator()

Guild:widgetChannel()

#

Performs widget channel on this Guild. Call it from bot code when you need that operation on the current object.

Signature

Guild:widgetChannel()

Parameters

No parameters.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:widgetChannel()

Guild:widgetImageURL()

#

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

Signature

Guild:widgetImageURL(style)

Parameters

NameTypeRequiredBehavior
style any optional Passed through to the implementation as written.

Returns

Guild — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Guild
object:widgetImageURL(style)

Static members

  • Guild.AnonymousGuild
  • Guild.BaseGuild
  • Guild.InviteGuild
  • Guild.OAuth2Guild

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