/
channel_config.go
56 lines (48 loc) · 1.91 KB
/
channel_config.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
package stream_chat
// ChannelConfig is the configuration for a channel.
type ChannelConfig struct {
Name string `json:"name"`
// features
// show typing indicators or not (probably auto disable if more than X users in a channel)
TypingEvents bool `json:"typing_events"`
// store who has read the message, or at least when they last viewed the chat
ReadEvents bool `json:"read_events"`
// connect events can get very noisy for larger chat groups
ConnectEvents bool `json:"connect_events"`
// make messages searchable
Search bool `json:"search"`
Reactions bool `json:"reactions"`
Reminders bool `json:"reminders"`
Replies bool `json:"replies"`
Mutes bool `json:"mutes"`
// enable/disable push notifications
PushNotifications bool `json:"push_notifications"`
Uploads bool `json:"uploads"`
URLEnrichment bool `json:"url_enrichment"`
CustomEvents bool `json:"custom_events"`
// number of days to keep messages, must be MessageRetentionForever or numeric string
MessageRetention string `json:"message_retention"`
MaxMessageLength int `json:"max_message_length"`
Automod modType `json:"automod"` // disabled, simple or AI
ModBehavior modBehaviour `json:"automod_behavior"`
BlockList string `json:"blocklist"`
BlockListBehavior modBehaviour `json:"blocklist_behavior"`
AutomodThresholds *Thresholds `json:"automod_thresholds"`
}
type LabelThresholds struct {
Flag float32 `json:"flag"`
Block float32 `json:"block"`
}
type Thresholds struct {
Explicit *LabelThresholds `json:"explicit"`
Spam *LabelThresholds `json:"spam"`
Toxic *LabelThresholds `json:"toxic"`
}
// DefaultChannelConfig is the default channel configuration.
var DefaultChannelConfig = ChannelConfig{
Automod: AutoModDisabled,
ModBehavior: ModBehaviourFlag,
MaxMessageLength: defaultMessageLength,
MessageRetention: MessageRetentionForever,
PushNotifications: true,
}