Nostrum.Api.AutoModeration (nostrum v0.11.0-dev)
View SourceFunctions 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
@spec create_rule(Nostrum.Struct.Guild.id(), Nostrum.Api.options()) :: {:ok, Nostrum.Struct.AutoModerationRule.t()} | Nostrum.Api.error()
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
.
- optional, based on the
: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
.
- optional, defaults to
: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.
- optional, defaults to
: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.
- optional, defaults to
@spec delete_rule(Nostrum.Struct.Guild.id(), Nostrum.Struct.AutoModerationRule.id()) :: {:ok} | Nostrum.Api.error()
Delete an auto-moderation rule for a guild.
@spec modify_rule( Nostrum.Struct.Guild.id(), Nostrum.Struct.AutoModerationRule.id(), Nostrum.Api.options() ) :: {:ok, Nostrum.Struct.AutoModerationRule.t()} | Nostrum.Api.error()
Modify an auto-moderation rule for a guild.
Takes the same options as create_rule/2
, however all fields are optional.
@spec rule(Nostrum.Struct.Guild.id(), Nostrum.Struct.AutoModerationRule.id()) :: {:ok, Nostrum.Struct.AutoModerationRule.t()} | Nostrum.Api.error()
Get a single auto-moderation rule for a guild.
@spec rules(Nostrum.Struct.Guild.id()) :: {:ok, [Nostrum.Struct.AutoModerationRule.t()]} | Nostrum.Api.error()
Get a list of all auto-moderation rules for a guild.