DiscordLua
discorddiscord
v1.2.4
Install

AutoModerationRuleManager

Manager
On this page

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

manager Module 1.2.4 REST Source

Constructor

AutoModerationRuleManager.new(client, guild)

The class table is callable, so AutoModerationRuleManager(client, guild) is the same as .new.

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

Properties

AutoModerationRuleManager.guild

# readonly
Name
guild
Type
any
Access
readonly
Description
Guild this AutoModerationRuleManager belongs to, when the payload included a guild id.
Availability
Populated from the Gateway/REST payload or constructor for this AutoModerationRuleManager.

Methods

AutoModerationRuleManager:create()

#

Create a new resource through REST and cache the result.

Signature

AutoModerationRuleManager:create(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

AutoModerationRuleManager — the same instance, for chaining.

Example

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

AutoModerationRuleManager:delete()

#

Permanently delete this resource through REST.

Signature

AutoModerationRuleManager:delete(rule, callback)

Parameters

NameTypeRequiredBehavior
rule any required Passed through to the implementation as written.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

AutoModerationRuleManager — the same instance, for chaining.

Example

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

AutoModerationRuleManager:edit()

#

Apply a REST update to this resource.

Signature

AutoModerationRuleManager:edit(rule, options, callback)

Parameters

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

AutoModerationRuleManager — the same instance, for chaining.

Example

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

AutoModerationRuleManager:fetch()

#

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

Signature

AutoModerationRuleManager:fetch(id, callback)

Parameters

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

Returns

AutoModerationRuleManager — the same instance, for chaining.

Example

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

AutoModerationRuleManager:path()

#

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

Signature

AutoModerationRuleManager:path(id)

Parameters

NameTypeRequiredBehavior
id string required Snowflake id string.

Returns

AutoModerationRuleManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a AutoModerationRuleManager
object:path("123")

Examples

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

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc