grom/guild/auto_moderation
Types
pub type Action {
BlockMessage(custom_message: option.Option(String))
SendAlertMessage(channel_id: String)
TimeoutMember(duration: duration.Duration)
BlockMemberInteraction
}
Constructors
-
BlockMessage(custom_message: option.Option(String)) -
SendAlertMessage(channel_id: String) -
TimeoutMember(duration: duration.Duration) -
BlockMemberInteraction
pub type CreateRule {
CreateRule(
name: String,
trigger: Trigger,
actions: List(Action),
is_enabled: Bool,
exempt_role_ids: option.Option(List(String)),
exempt_channel_ids: option.Option(List(String)),
)
}
Constructors
-
CreateRule( name: String, trigger: Trigger, actions: List(Action), is_enabled: Bool, exempt_role_ids: option.Option(List(String)), exempt_channel_ids: option.Option(List(String)), )
pub type KeywordPreset {
ProfanityPreset
SexualContentPreset
SlursPreset
}
Constructors
-
ProfanityPreset -
SexualContentPreset -
SlursPreset
pub type ModifyRule {
ModifyRule(
name: option.Option(String),
trigger: option.Option(Trigger),
actions: option.Option(List(Action)),
is_enabled: option.Option(Bool),
exempt_role_ids: option.Option(List(String)),
exempt_channel_ids: option.Option(List(String)),
)
}
Constructors
-
ModifyRule( name: option.Option(String), trigger: option.Option(Trigger), actions: option.Option(List(Action)), is_enabled: option.Option(Bool), exempt_role_ids: option.Option(List(String)), exempt_channel_ids: option.Option(List(String)), )Arguments
- trigger
-
You can only modify the inner data, you can’t change the trigger.
pub type Trigger {
KeywordTrigger(
keyword_filter: List(String),
regex_patterns: List(String),
allow_list: List(String),
)
MemberProfileTrigger(
keyword_filter: List(String),
regex_patterns: List(String),
allow_list: List(String),
)
KeywordPresetTrigger(
presets: List(KeywordPreset),
allow_list: List(String),
)
MentionSpamTrigger(
total_mention_limit: Int,
is_mention_raid_protection_enabled: Bool,
)
SpamTrigger
}
Constructors
-
KeywordTrigger( keyword_filter: List(String), regex_patterns: List(String), allow_list: List(String), ) -
MemberProfileTrigger( keyword_filter: List(String), regex_patterns: List(String), allow_list: List(String), ) -
KeywordPresetTrigger( presets: List(KeywordPreset), allow_list: List(String), ) -
MentionSpamTrigger( total_mention_limit: Int, is_mention_raid_protection_enabled: Bool, ) -
SpamTrigger
pub type TriggerType {
Keyword
Spam
KeywordPreset
MentionSpam
MemberProfile
}
Constructors
-
Keyword -
Spam -
KeywordPreset -
MentionSpam -
MemberProfile
Values
pub fn create_rule(
client: grom.Client,
in guild_id: String,
with create_rule: CreateRule,
because reason: option.Option(String),
) -> Result(Rule, grom.Error)
pub fn delete_rule(
client: grom.Client,
from guild_id: String,
id rule_id: String,
because reason: option.Option(String),
) -> Result(Nil, grom.Error)
pub fn get_rule(
client: grom.Client,
from guild_id: String,
id rule_id: String,
) -> Result(Rule, grom.Error)
pub fn modify_rule(
client: grom.Client,
in guild_id: String,
id rule_id: String,
with modify_rule: ModifyRule,
because reason: option.Option(String),
) -> Result(Rule, grom.Error)
pub fn new_create_rule(
named name: String,
on trigger: Trigger,
do actions: List(Action),
enable is_enabled: Bool,
) -> CreateRule
pub fn new_modify_rule() -> ModifyRule