-
Notifications
You must be signed in to change notification settings - Fork 1
/
auto_moderation.go
72 lines (58 loc) · 2.72 KB
/
auto_moderation.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package objects
//go:generate stringer -type=AutoModerationEventType,AutoModerationTriggerType,AutoModerationKeywordPresetType,AutoModerationActionType -trimprefix=AutoModeration -output auto_moderation_string.go
type AutoModerationRule struct {
ID Snowflake `json:"id"`
GuildID Snowflake `json:"guild_id"`
Name string `json:"name"`
CreatorID Snowflake `json:"creator_id"`
EventType AutoModerationEventType `json:"event_type"`
TriggerType AutoModerationTriggerType `json:"trigger_type"`
TriggerMetadata TriggerMetadata `json:"trigger_metadata"`
Actions []*AutoModerationAction `json:"actions"`
Enabled bool `json:"enabled"`
ExemptRoles []Snowflake `json:"exempt_roles"`
ExemptChannel []Snowflake `json:"exempt_channels"`
}
type AutoModerationEventType uint64
const (
AutoModerationEventTypeMessageSend AutoModerationEventType = iota + 1
)
type AutoModerationTriggerType uint64
const (
AutoModerationTriggerTypeKeyword AutoModerationTriggerType = iota + 1
AutoModerationTriggerTypeSpam
AutoModerationTriggerTypeKeywordPreset
AutoModerationTriggerTypeMentionSpam
)
type TriggerMetadata struct {
KeywordFilter []string `json:"keyword_filter,omitempty"`
Presets []AutoModerationKeywordPresetType `json:"presets,omitempty"`
AllowList []string `json:"allow_list,omitempty"`
MentionTotalLimit int `json:"mention_total_limit"`
}
type AutoModerationKeywordPresetType uint64
const (
AutoModerationKeywordPresetTypeProfanity AutoModerationKeywordPresetType = iota + 1
AutoModerationKeywordPresetTypeSexualContent
AutoModerationKeywordPresetTypeSlurs
)
type AutoModerationAction struct {
Type AutoModerationActionType `json:"type"`
Metadata *AutoModerationActionMetadata `json:"metadata,omitempty"`
}
type AutoModerationActionType uint64
const (
AutoModerationActionTypeBlockMessage AutoModerationActionType = iota + 1
AutoModerationActionTypeSendAlertMessage
AutoModerationActionTypeTimeout
)
type AutoModerationActionMetadata struct {
ChannelID Snowflake `json:"channel_id,omitempty"`
DurationSeconds int64 `json:"duration_seconds,omitempty"`
}
type AutoModerationTriggerMetadata struct {
KeywordFilter []string `json:"keyword_filter,omitempty"`
Presets []AutoModerationKeywordPresetType `json:"presets,omitempty"`
AllowList []string `json:"allow_list,omitempty"`
MentionTotalLimit int `json:"mention_total_limit,omitempty"`
}