TriggeredAutoModRule
TriggeredAutoModRule ⇐ Base
Represents a triggered auto moderation rule.
Kind: global class
Extends: Base
- TriggeredAutoModRule ⇐
Base
- new TriggeredAutoModRule([data], guildId, client)
- .guild ⇒
- .channel ⇒
- .user ⇒
- .message ⇒
- .fetch(options) ⇒
Promise
- .edit(options) ⇒
Promise
- .delete(reason) ⇒
Promise.<void>
- .setName(name, reason) ⇒
Promise
- .setEventType(eventType, reason) ⇒
Promise
- .setTriggerMetadata(triggerMetadata, reason) ⇒
Promise.<void>
- .setActions(actions, reason) ⇒
Promise.<any>
- .setEnabled(enabled, reason) ⇒
Promise
- .setExemptRoles(exemptRoles, reason) ⇒
Promise
- .setExemptChannels(exemptChannels, reason) ⇒
Promise
new TriggeredAutoModRule([data], guildId, client)
Constructs a GuildAutoModRule object.
Param | Type | Description |
---|---|---|
[data] | Object | The data for the triggered auto moderation rule. |
guildId | string | The ID of the guild that the rule belongs to. |
client | Client | The 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.
Param | Type | Description |
---|---|---|
options | object | Optional 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.
Param | Type | Description |
---|---|---|
options | Object | The 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.
Param | Type | Description |
---|---|---|
reason | string | The 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.
Param | Type | Description |
---|---|---|
name | string | The new name to set. |
reason | string | The 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.
Param | Type | Description |
---|---|---|
eventType | string | The type of event to set. |
reason | string | The 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.
Param | Type | Description |
---|---|---|
triggerMetadata | any | The new trigger metadata to set. |
reason | string | The 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.
Param | Type | Description |
---|---|---|
actions | any | The actions to be set. |
reason | string | The 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.
Param | Type | Description |
---|---|---|
enabled | boolean | The new enabled status of the item. |
reason | string | The 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.
Param | Type | Description |
---|---|---|
exemptRoles | Array | The roles that are exempt from the action. |
reason | string | The 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.
Param | Type | Description |
---|---|---|
exemptChannels | Array | The channels to exempt from the action. |
reason | string | The reason for setting the exempt channels. |