AutoModerationRuleManager
ManagerOn 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.
Constructor
AutoModerationRuleManager.new(client, guild) The class table is callable, so AutoModerationRuleManager(client, guild) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
client |
any |
required | Passed through to the implementation as written. |
guild |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.AutoModerationRuleManager({}, {})Properties
- 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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
id |
string |
required | Snowflake id string. |
Returns
AutoModerationRuleManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRuleManager
object:path("123")Examples
local discord = require("discord")
local object = discord.AutoModerationRuleManager({})Related APIs
ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager · ChannelManager
Version: discord 1.2.4 · runtime 1.0.0