Nostrum.Api.AutoModeration (nostrum v0.11.0-dev)

View Source

Functions for interacting with the Discord API's auto-moderation endpoints.

See: https://discord.com/developers/docs/resources/auto-moderation

Summary

Functions

Create a new auto-moderation rule for a guild.

Delete an auto-moderation rule for a guild.

Modify an auto-moderation rule for a guild.

Get a single auto-moderation rule for a guild.

Get a list of all auto-moderation rules for a guild.

Functions

create_rule(guild_id, options)

(since 1.x.x)

Create a new auto-moderation rule for a guild.

Options

  • :name (String.t/0) - The name of the rule.
  • :event_type (t:AutoModerationRule.event_type/0) - The type of event that triggers the rule.
  • :trigger_type (t:AutoModerationRule.trigger_type/0) - The type of content that triggers the rule.
  • :trigger_metadata (t:AutoModerationRule.trigger_metadata/0) - The metadata associated with the rule trigger.
    • optional, based on the :trigger_type.
  • :actions (t:AutoModerationRule.actions/0) - The actions to take when the rule is triggered.
  • :enabled (t:AutoModerationRule.enabled/0) - Whether the rule is enabled or not.
    • optional, defaults to false.
  • :exempt_roles - (t:AutoModerationRule.exempt_roles/0) - A list of role id's that are exempt from the rule.
    • optional, defaults to [], maximum of 20.
  • :exempt_channels - (t:AutoModerationRule.exempt_channels/0) - A list of channel id's that are exempt from the rule.
    • optional, defaults to [], maximum of 50.

delete_rule(guild_id, rule_id)

(since 1.x.x)

Delete an auto-moderation rule for a guild.

modify_rule(guild_id, rule_id, options)

(since 1.x.x)

Modify an auto-moderation rule for a guild.

Takes the same options as create_rule/2, however all fields are optional.

rule(guild_id, rule_id)

(since 1.x.x)

Get a single auto-moderation rule for a guild.

rules(guild_id)

(since 1.x.x)

Get a list of all auto-moderation rules for a guild.