Skip to content

TriggerMetadata

Implementation of the Discord TriggerMetadata class in Luau

https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata

Properties

keywordFilter

TriggerMetadata.keywordFilter  :: { string }

List of strings that will trigger the rule. Each keyword can be up to 60 characters in length and can include spaces.

regexPatterns

TriggerMetadata.regexPatterns  :: { string }

Array of regular expression patterns that will trigger the rule. Each regex pattern can be up to 260 characters in length.

presets

TriggerMetadata.presets  :: { apiTypes.KeywordPresetType }

The internally pre-defined wordsets that will trigger the rule. These are managed by Discord and cannot be modified.

allowList

TriggerMetadata.allowList  :: { string }

Substrings that should not trigger the rule. Each string can be up to 60 characters in length and can include spaces.

mentionRaidProtectionEnabled

TriggerMetadata.mentionRaidProtectionEnabled  :: boolean

Whether to automatically detect mention raids and apply the rule action. Only available for mention spam trigger type.

Methods

The TriggerMetadata instance has no set methods!

Functions

sync

TriggerMetadata . sync (

     self: TriggerMetadata
     triggerMetadataData: apiTypes.AutomoderationRuleTriggerMetadataObject
)  -> ()

Responsible for syncing data to this trigger metadata object. This is typically called by the API when this object is created or updated.

new

TriggerMetadata . new (

     triggerMetadataData: apiTypes.AutomoderationRuleTriggerMetadataObject
)  -> ()

Responsible for constructing this class.