DiscordLua
discorddiscord
v1.2.4
Install

PermissionOverwriteManager

Manager
On this page

PermissionOverwriteManager is the cache and REST facade for PermissionOverwrite objects owned by the parent. Typical calls are fetch, create, edit, delete, resolve, and resolveId.

manager Module 1.2.4 Source

Constructor

PermissionOverwriteManager.new(client, channel)

The class table is callable, so PermissionOverwriteManager(client, channel) is the same as .new.

NameTypeRequiredBehavior
client any required Passed through to the implementation as written.
channel any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.PermissionOverwriteManager({}, {})

Properties

PermissionOverwriteManager.channel

# readonly
Name
channel
Type
any
Access
readonly
Description
Channel this PermissionOverwriteManager belongs to, when resolved from cache.
Availability
Populated from the Gateway/REST payload or constructor for this PermissionOverwriteManager.

Methods

PermissionOverwriteManager:create()

#

Create a new resource through REST and cache the result.

Signature

PermissionOverwriteManager:create(userOrRole, options, extra, callback)

Parameters

NameTypeRequiredBehavior
userOrRole 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.
extra any optional Passed through to the implementation as written.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

PermissionOverwriteManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwriteManager
object:create(userOrRole, {}, extra, function(err, result)
    if err then error(err) end
end)

PermissionOverwriteManager:delete()

#

Permanently delete this resource through REST.

Signature

PermissionOverwriteManager:delete(userOrRole, reason, callback)

Parameters

NameTypeRequiredBehavior
userOrRole 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

any.

Example

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

PermissionOverwriteManager:edit()

#

Apply a REST update to this resource.

Signature

PermissionOverwriteManager:edit(userOrRole, options, extra, callback)

Parameters

NameTypeRequiredBehavior
userOrRole 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.
extra any optional Passed through to the implementation as written.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

PermissionOverwriteManager — the same instance, for chaining.

Example

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

PermissionOverwriteManager.encode()

# static

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

Signature

PermissionOverwriteManager.encode(options, existing)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.
existing any required Passed through to the implementation as written.

Returns

PermissionOverwriteManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwriteManager
PermissionOverwriteManager.encode({}, existing)

PermissionOverwriteManager:resolveId()

#

Resolve a snowflake, object, or mention to an id string.

Signature

PermissionOverwriteManager:resolveId(userOrRole)

Parameters

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

Returns

any.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwriteManager
object:resolveId(userOrRole)

PermissionOverwriteManager:set()

#

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

Signature

PermissionOverwriteManager:set(overwrites, reason, callback)

Parameters

NameTypeRequiredBehavior
overwrites 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

any.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwriteManager
object:set(overwrites, reason, function(err, result)
    if err then error(err) end
end)

Examples

lua
local discord = require("discord")
local object = discord.PermissionOverwriteManager({})

ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc