Skip to content

TriggeredAutoModRule

TriggeredAutoModRule ⇐ Base

Represents a triggered auto moderation rule.

Kind: global class
Extends: Base

new TriggeredAutoModRule([data], guildId, client)

Constructs a GuildAutoModRule object.

ParamTypeDescription
[data]ObjectThe data for the triggered auto moderation rule.
guildIdstringThe ID of the guild that the rule belongs to.
clientClientThe client instance.

triggeredAutoModRule.guild ⇒

Get the guild object associated with this guildId.

Kind: instance property of TriggeredAutoModRule
Returns: The guild object.

triggeredAutoModRule.channel ⇒

Retrieves the channel object associated with this instance.

Kind: instance property of TriggeredAutoModRule
Returns: The channel object.

triggeredAutoModRule.user ⇒

Get the user object associated with this instance.

Kind: instance property of TriggeredAutoModRule
Returns: The user object.

triggeredAutoModRule.message ⇒

Retrieves the message from the channel using the specified message ID.

Kind: instance property of TriggeredAutoModRule
Returns: The retrieved message object.

triggeredAutoModRule.fetch(options) ⇒ Promise

Fetches the automod rule with the specified ruleId from the guild.

Kind: instance method of TriggeredAutoModRule
Returns: Promise - A promise that resolves to the fetched automod rule.

ParamTypeDescription
optionsobjectOptional parameters for the fetch request.

triggeredAutoModRule.edit(options) ⇒ Promise

Edits the automod rule with the specified options.

Kind: instance method of TriggeredAutoModRule
Returns: Promise - A promise that resolves when the automod rule has been successfully edited.

ParamTypeDescription
optionsObjectThe options to update the automod rule.

triggeredAutoModRule.delete(reason) ⇒ Promise.<void>

Deletes the automod rule with the specified reason.

Kind: instance method of TriggeredAutoModRule
Returns: Promise.<void> - - A promise that resolves when the rule is successfully deleted.

ParamTypeDescription
reasonstringThe reason for deleting the rule.

triggeredAutoModRule.setName(name, reason) ⇒ Promise

Sets the name and reason for an object.

Kind: instance method of TriggeredAutoModRule
Returns: Promise - - A promise that resolves when the name and reason are successfully set.

ParamTypeDescription
namestringThe new name to set.
reasonstringThe reason for setting the new name.

triggeredAutoModRule.setEventType(eventType, reason) ⇒ Promise

Sets the event type and reason for the current object.

Kind: instance method of TriggeredAutoModRule
Returns: Promise - - A promise that resolves when the edit is complete.

ParamTypeDescription
eventTypestringThe type of event to set.
reasonstringThe reason for the event.

triggeredAutoModRule.setTriggerMetadata(triggerMetadata, reason) ⇒ Promise.<void>

Sets the trigger metadata for the current object and updates it with the given reason.

Kind: instance method of TriggeredAutoModRule
Returns: Promise.<void> - - A promise that resolves when the trigger metadata is successfully set.

ParamTypeDescription
triggerMetadataanyThe new trigger metadata to set.
reasonstringThe reason for updating the trigger metadata.

triggeredAutoModRule.setActions(actions, reason) ⇒ Promise.<any>

Sets the actions and reason for editing a resource.

Kind: instance method of TriggeredAutoModRule
Returns: Promise.<any> - - A promise that resolves to the result of the edit operation.

ParamTypeDescription
actionsanyThe actions to be set.
reasonstringThe reason for the edit.

triggeredAutoModRule.setEnabled(enabled, reason) ⇒ Promise

Sets the enabled status of an item and provides a reason for the change.

Kind: instance method of TriggeredAutoModRule
Returns: Promise - - A promise that resolves when the edit is complete.

ParamTypeDescription
enabledbooleanThe new enabled status of the item.
reasonstringThe reason for the change in enabled status.

triggeredAutoModRule.setExemptRoles(exemptRoles, reason) ⇒ Promise

Sets the exempt roles for a certain action and provides a reason for the change.

Kind: instance method of TriggeredAutoModRule
Returns: Promise - - A promise that resolves when the exempt roles are successfully set.

ParamTypeDescription
exemptRolesArrayThe roles that are exempt from the action.
reasonstringThe reason for setting the exempt roles.

triggeredAutoModRule.setExemptChannels(exemptChannels, reason) ⇒ Promise

Sets the exempt channels for a specific action and provides a reason.

Kind: instance method of TriggeredAutoModRule
Returns: Promise - - A promise that resolves when the exempt channels are set.

ParamTypeDescription
exemptChannelsArrayThe channels to exempt from the action.
reasonstringThe reason for setting the exempt channels.