AutoModerationRule
ClassOn this page
AutoModerationRule 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
actions- Type
any- Access
- mutable
- Description
- Instance field
AutoModerationRule.actions. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- 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 AutoModerationRule.
- Name
creatorId- Type
any- Access
- readonly
- Description
- Instance field
AutoModerationRule.creatorId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- Name
enabled- Type
any- Access
- mutable
- Description
- Instance field
AutoModerationRule.enabled. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- Name
eventType- Type
any- Access
- mutable
- Description
- Instance field
AutoModerationRule.eventType. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- Name
exemptChannels- Type
any- Access
- mutable
- Description
- Instance field
AutoModerationRule.exemptChannels. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- Name
exemptRoles- Type
any- Access
- mutable
- Description
- Instance field
AutoModerationRule.exemptRoles. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- Name
guildId- Type
any- Access
- readonly
- Description
- Instance field
AutoModerationRule.guildId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this AutoModerationRule.
- Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- Name
name- Type
any- Access
- mutable
- Description
- Display name of this AutoModerationRule.
- Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
AutoModerationRule.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 AutoModerationRule.
- Name
triggerMetadata- Type
any- Access
- readonly
- Description
- Instance field
AutoModerationRule.triggerMetadata. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
- Name
triggerType- Type
any- Access
- readonly
- Description
- Instance field
AutoModerationRule.triggerType. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this AutoModerationRule.
Methods
AutoModerationRule:delete()
#Permanently delete this resource through REST.
Signature
AutoModerationRule:delete(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:delete(function(err, result)
if err then error(err) end
end)AutoModerationRule:edit()
#Apply a REST update to this resource.
Signature
AutoModerationRule:edit(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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:edit({}, function(err, result)
if err then error(err) end
end)AutoModerationRule:guild()
#Performs guild on this AutoModerationRule. Call it from bot code when you need that operation on the current object.
Signature
AutoModerationRule:guild() Parameters
No parameters.
Returns
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:guild()AutoModerationRule:setActions()
#Set the Actions field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setActions(actions, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
actions |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setActions(actions, function(err, result)
if err then error(err) end
end)AutoModerationRule:setAllowList()
#Set the AllowList field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setAllowList(allowList, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
allowList |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setAllowList(allowList, function(err, result)
if err then error(err) end
end)AutoModerationRule:setEnabled()
#Set the Enabled field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setEnabled(enabled, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
enabled |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setEnabled(enabled, function(err, result)
if err then error(err) end
end)AutoModerationRule:setEventType()
#Set the EventType field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setEventType(eventType, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
eventType |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setEventType(eventType, function(err, result)
if err then error(err) end
end)AutoModerationRule:setExemptChannels()
#Set the ExemptChannels field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setExemptChannels(channels, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
channels |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setExemptChannels(channels, function(err, result)
if err then error(err) end
end)AutoModerationRule:setExemptRoles()
#Set the ExemptRoles field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setExemptRoles(roles, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
roles |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setExemptRoles(roles, function(err, result)
if err then error(err) end
end)AutoModerationRule:setKeywordFilter()
#Set the KeywordFilter field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setKeywordFilter(keywords, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
keywords |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setKeywordFilter(keywords, function(err, result)
if err then error(err) end
end)AutoModerationRule:setMentionRaidProtectionEnabled()
#Set the MentionRaidProtectionEnabled field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setMentionRaidProtectionEnabled(enabled, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
enabled |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setMentionRaidProtectionEnabled(enabled, function(err, result)
if err then error(err) end
end)AutoModerationRule:setMentionTotalLimit()
#Set the MentionTotalLimit field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setMentionTotalLimit(limit, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
limit |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setMentionTotalLimit(limit, function(err, result)
if err then error(err) end
end)AutoModerationRule:setName()
#Set the Name field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setName(name, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setName(name, function(err, result)
if err then error(err) end
end)AutoModerationRule:setPresets()
#Set the Presets field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setPresets(presets, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
presets |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setPresets(presets, function(err, result)
if err then error(err) end
end)AutoModerationRule:setRegexPatterns()
#Set the RegexPatterns field. Builders return this AutoModerationRule so setters can be chained.
Signature
AutoModerationRule:setRegexPatterns(patterns, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
patterns |
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
AutoModerationRule — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a AutoModerationRule
object:setRegexPatterns(patterns, function(err, result)
if err then error(err) end
end)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