-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
guild_const.go
151 lines (124 loc) · 4.12 KB
/
guild_const.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
package discord
import (
"github.com/diamondburned/arikawa/utils/json/enum"
)
// Guild.MaxPresences is 5000 when it's 0.
const DefaultMaxPresences = 5000
type NitroBoost uint8
const (
NoNitroLevel NitroBoost = iota
NitroLevel1
NitroLevel2
NitroLevel3
)
type MFALevel uint8
const (
NoMFA MFALevel = iota
ElevatedMFA
)
type GuildFeature string
const (
// Guild has access to set an invite splash background
InviteSplash GuildFeature = "INVITE_SPLASH"
// Guild has access to set 384kbps bitrate in voice (previously VIP voice
// servers)
VIPRegions GuildFeature = "VIP_REGIONS"
// Guild has access to set a vanity URL
VanityURL GuildFeature = "VANITY_URL"
// Guild is verified
Verified GuildFeature = "VERIFIED"
// Guild is partnered
Partnered GuildFeature = "PARTNERED"
// Guild is public
Public GuildFeature = "PUBLIC"
// Guild has access to use commerce features (i.e. create store channels)
Commerce GuildFeature = "COMMERCE"
// Guild has access to create news channels
News GuildFeature = "NEWS"
// Guild is able to be discovered in the directory
Discoverable GuildFeature = "DISCOVERABLE"
// Guild is able to be featured in the directory
Featurable GuildFeature = "FEATURABLE"
// Guild has access to set an animated guild icon
AnimatedIcon GuildFeature = "ANIMATED_ICON"
// Guild has access to set a guild banner image
Banner GuildFeature = "BANNER"
)
// ExplicitFilter is the explicit content filter level of a guild.
type ExplicitFilter enum.Enum
var (
// NullExplicitFilter serialized to JSON null.
// This should only be used on nullable fields.
NullExplicitFilter ExplicitFilter = enum.Null
// NoContentFilter disables content filtering for the guild.
NoContentFilter ExplicitFilter = 0
// MembersWithoutRoles filters only members without roles.
MembersWithoutRoles ExplicitFilter = 1
// AllMembers enables content filtering for all members.
AllMembers ExplicitFilter = 2
)
func (f *ExplicitFilter) UnmarshalJSON(b []byte) error {
i, err := enum.FromJSON(b)
*f = ExplicitFilter(i)
return err
}
func (f ExplicitFilter) MarshalJSON() ([]byte, error) {
return enum.ToJSON(enum.Enum(f)), nil
}
// Notification is the default message notification level of a guild.
type Notification enum.Enum
var (
// NullNotification serialized to JSON null.
// This should only be used on nullable fields.
NullNotification Notification = enum.Null
// AllMessages sends notifications for all messages.
AllMessages Notification = 0
// OnlyMentions sends notifications only on mention.
OnlyMentions Notification = 1
)
func (n *Notification) UnmarshalJSON(b []byte) error {
i, err := enum.FromJSON(b)
*n = Notification(i)
return err
}
func (n Notification) MarshalJSON() ([]byte, error) { return enum.ToJSON(enum.Enum(n)), nil }
// Verification is the verification level required for a guild.
type Verification enum.Enum
var (
// NullVerification serialized to JSON null.
// This should only be used on nullable fields.
NullVerification Verification = enum.Null
// NoVerification required no verification.
NoVerification Verification = 0
// LowVerification requires a verified email
LowVerification Verification = 1
// MediumVerification requires the user be registered for at least 5
// minutes.
MediumVerification Verification = 2
// HighVerification requires the member be in the server for more than 10
// minutes.
HighVerification Verification = 3
// VeryHighVerification requires the member to have a verified phone
// number.
VeryHighVerification Verification = 4
)
func (v *Verification) UnmarshalJSON(b []byte) error {
i, err := enum.FromJSON(b)
*v = Verification(i)
return err
}
func (v Verification) MarshalJSON() ([]byte, error) { return enum.ToJSON(enum.Enum(v)), nil }
// Service is used for guild integrations and user connections.
type Service string
const (
Twitch Service = "twitch"
YouTube Service = "youtube"
)
// ExpireBehavior is the integration expire behavior that regulates what happens, if a subscriber expires.
type ExpireBehavior uint8
var (
// RemoveRole removes the role of the subscriber.
RemoveRole ExpireBehavior = 0
// Kick kicks the subscriber from the guild.
Kick ExpireBehavior = 1
)