LogoAntiRaid

@discord-types/builders/automoderation/rule

API reference for @discord-types/builders/automoderation/rule

@discord-types/builders/automoderation/rule

Types

AutomoderationRule

Raw Type
type AutomoderationRule = AutomoderationRule.Prototype, & {
	name: string,

	eventType: apiTypes.AutomoderationRuleEventType,

	triggerType: apiTypes.AutomoderationRuleTriggerType,

	triggerMetadata: triggerMetadata.JSON?,

	actions: {action.JSON},

	enabled: boolean?,

	exemptRoles: {apiTypes.Snowflake}?,

	exemptChannels: {apiTypes.Snowflake}?
}

Intersection with variants:

Variant 2
PropTypeDescription
name
-
eventType
-
triggerType
-
triggerMetadata?
-
actions
-
enabled?
-
exemptRoles?
-
exemptChannels?
-

JSON

Raw Type
type JSON = AutomoderationRule.Prototype.build(nil :: any),

Functions

AutomoderationRule.Prototype.setName

[[ Sets the name of the automoderation rule. ]]

Function Signature
--[[
	Sets the name of the automoderation rule.
]]
function AutomoderationRule.Prototype.setName(self: AutomoderationRule, name: string) -> AutomoderationRule end

Arguments

name

string

Returns

ret1

AutomoderationRule

AutomoderationRule.Prototype.setEventType

[[ Sets the event type for the automoderation rule. ]]

Function Signature
--[[
	Sets the event type for the automoderation rule.
]]
function AutomoderationRule.Prototype.setEventType(self: AutomoderationRule, eventType: apiTypes.AutomoderationRuleEventType) -> AutomoderationRule end

Arguments

eventType

apiTypes.AutomoderationRuleEventType

Returns

ret1

AutomoderationRule

AutomoderationRule.Prototype.setTriggerType

[[ Sets the trigger type for the automoderation rule. ]]

Function Signature
--[[
	Sets the trigger type for the automoderation rule.
]]
function AutomoderationRule.Prototype.setTriggerType(self: AutomoderationRule, triggerType: apiTypes.AutomoderationRuleTriggerType) -> AutomoderationRule end

Arguments

triggerType

apiTypes.AutomoderationRuleTriggerType

Returns

ret1

AutomoderationRule

AutomoderationRule.Prototype.setTriggerMetadata

[[ Sets the trigger metadata for the automoderation rule. ]]

Function Signature
--[[
	Sets the trigger metadata for the automoderation rule.
]]
function AutomoderationRule.Prototype.setTriggerMetadata(self: AutomoderationRule, triggerMetadata: triggerMetadata.JSON) -> AutomoderationRule end

Arguments

triggerMetadata

triggerMetadata.JSON

Returns

ret1

AutomoderationRule

AutomoderationRule.Prototype.setActions

[[ Sets the actions for the automoderation rule. ]]

Function Signature
--[[
	Sets the actions for the automoderation rule.
]]
function AutomoderationRule.Prototype.setActions(self: AutomoderationRule, actions: {action.JSON}) -> AutomoderationRule end

Arguments

actions

{action.JSON}

Returns

ret1

AutomoderationRule

AutomoderationRule.Prototype.setEnabled

[[ Sets whether the automoderation rule is enabled. ]]

Function Signature
--[[
	Sets whether the automoderation rule is enabled.
]]
function AutomoderationRule.Prototype.setEnabled(self: AutomoderationRule, enabled: boolean) -> AutomoderationRule end

Arguments

enabled

boolean

Returns

ret1

AutomoderationRule

AutomoderationRule.Prototype.setExemptRoles

[[ Sets the exempt roles for the automoderation rule. ]]

Function Signature
--[[
	Sets the exempt roles for the automoderation rule.
]]
function AutomoderationRule.Prototype.setExemptRoles(self: AutomoderationRule, exemptRoles: {apiTypes.Snowflake}) -> AutomoderationRule end

Arguments

exemptRoles

{apiTypes.Snowflake}

Returns

ret1

AutomoderationRule

AutomoderationRule.Prototype.setExemptChannels

[[ Sets the exempt channels for the automoderation rule. ]]

Function Signature
--[[
	Sets the exempt channels for the automoderation rule.
]]
function AutomoderationRule.Prototype.setExemptChannels(self: AutomoderationRule, exemptChannels: {apiTypes.Snowflake}) -> AutomoderationRule end

Arguments

exemptChannels

{apiTypes.Snowflake}

Returns

ret1

AutomoderationRule

AutomoderationRule.Prototype.build

[[ Builds the automoderation rule object. ]]

Function Signature
--[[
	Builds the automoderation rule object.
]]
function AutomoderationRule.Prototype.build(self: AutomoderationRule) -> JSON end

Returns

ret1

JSON

AutomoderationRule.Interface.new

[[ Responsible for creating a new AutomoderationRule.

```lua

``` ]]

Function Signature
--[[
	Responsible for creating a new AutomoderationRule.

	\`\`\`lua
	
	\`\`\`
]]
function AutomoderationRule.Interface.new(resource: {
		name: string?,

		eventType: apiTypes.AutomoderationRuleEventType?,

		triggerType: apiTypes.AutomoderationRuleTriggerType?,

		triggerMetadata: triggerMetadata.JSON?,

		actions: {action.JSON}?,

		enabled: boolean?,

		exemptRoles: {apiTypes.Snowflake}?,

		exemptChannels: {apiTypes.Snowflake}?
	}?) -> AutomoderationRule end

Arguments

resource

This field is optional and may not be specified

{name: string?, eventType: apiTypes.AutomoderationRuleEventType?, triggerType: apiTypes.AutomoderationRuleTriggerType?, triggerMetadata: triggerMetadata.JSON?, actions: {action.JSON}?, enabled: boolean?, exemptRoles: {apiTypes.Snowflake}?, exemptChannels: {apiTypes.Snowflake}?}?

Returns

ret1

AutomoderationRule

Last updated on