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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
using System.Text.Json.Serialization;
namespace Spacebar.ConfigModel;
public class LimitsConfiguration {
[JsonPropertyName("user")]
public UserLimits User { get; set; } = new UserLimits();
[JsonPropertyName("guild")]
public GuildLimits Guild { get; set; } = new GuildLimits();
[JsonPropertyName("message")]
public MessageLimits Message { get; set; } = new MessageLimits();
[JsonPropertyName("channel")]
public ChannelLimits Channel { get; set; } = new ChannelLimits();
[JsonPropertyName("rate")]
public RateLimits Rate { get; set; } = new RateLimits();
[JsonPropertyName("absoluteRate")]
public GlobalRateLimits AbsoluteRate { get; set; } = new GlobalRateLimits();
}
public class GlobalRateLimits {
[JsonPropertyName("register")]
public GlobalRateLimit Register { get; set; } = new() {
Enabled = true,
Count = 25,
Window = 60 * 60 * 1000
};
[JsonPropertyName("sendMessage")]
public GlobalRateLimit SendMessage { get; set; } = new() {
Enabled = true,
Count = 200,
Window = 60 * 1000
};
public class GlobalRateLimit : RateLimits.RateLimitOptions {
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
}
}
public class RateLimits {
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
[JsonPropertyName("ip")]
public RateLimitOptions Ip { get; set; } = new RateLimitOptions() {
Count = 500,
Window = 5
};
[JsonPropertyName("global")]
public RateLimitOptions Global { get; set; } = new RateLimitOptions() {
Count = 250,
Window = 5
};
[JsonPropertyName("error")]
public RateLimitOptions Error { get; set; } = new RateLimitOptions() {
Count = 50,
Window = 5
};
[JsonPropertyName("routes")]
public RouteRateLimits Routes { get; set; } = new RouteRateLimits();
public class RouteRateLimits {
[JsonPropertyName("guild")]
public RateLimitOptions Guild { get; set; } = new RateLimitOptions() {
Count = 5,
Window = 5
};
[JsonPropertyName("webhook")]
public RateLimitOptions Webhook { get; set; } = new RateLimitOptions() {
Count = 10,
Window = 5
};
[JsonPropertyName("channel")]
public RateLimitOptions Channel { get; set; } = new RateLimitOptions() {
Count = 10,
Window = 5
};
[JsonPropertyName("auth")]
public AuthRateLimits Auth { get; set; } = new AuthRateLimits();
public class AuthRateLimits {
[JsonPropertyName("login")]
public RateLimitOptions Login { get; set; } = new RateLimitOptions() {
Count = 5,
Window = 60
};
[JsonPropertyName("register")]
public RateLimitOptions Register { get; set; } = new RateLimitOptions() {
Count = 2,
Window = 60 * 60 * 12
};
}
}
public class RateLimitOptions {
[JsonPropertyName("count")]
public int Count { get; set; }
[JsonPropertyName("window")]
public int Window { get; set; }
[JsonIgnore]
public TimeSpan WindowTimeSpan => TimeSpan.FromSeconds(Window);
}
}
public class ChannelLimits {
[JsonPropertyName("maxPins")]
public int MaxPins { get; set; } = 500;
[JsonPropertyName("maxTopic")]
public int MaxTopic { get; set; } = 1024;
[JsonPropertyName("maxWebhooks")]
public int MaxWebhooks { get; set; } = 100;
}
public class MessageLimits {
[JsonPropertyName("maxCharacters")]
public int MaxCharacters { get; set; } = 1048576;
[JsonPropertyName("maxTTSCharacters")]
public int MaxTTSCharacters { get; set; } = 160;
[JsonPropertyName("maxReactions")]
public int MaxReactions { get; set; } = 2048;
[JsonPropertyName("maxAttachmentSize")]
public int MaxAttachmentSize { get; set; } = 1024 * 1024 * 1024;
[JsonPropertyName("maxBulkDelete")]
public int MaxBulkDelete { get; set; } = 1000;
[JsonPropertyName("maxEmbedDownloadSize")]
public int MaxEmbedDownloadSize { get; set; } = 1024 * 1024 * 1024;
[JsonPropertyName("maxPreloadCount")]
public int MaxPreloadCount { get; set; } = 100;
}
public class GuildLimits {
[JsonPropertyName("maxRoles")]
public int MaxRoles { get; set; } = 1000;
[JsonPropertyName("maxEmojis")]
public int MaxEmojis { get; set; } = 2000;
[JsonPropertyName("maxStickers")]
public int MaxStickers { get; set; } = 500;
[JsonPropertyName("maxMembers")]
public int MaxMembers { get; set; } = 25000000;
[JsonPropertyName("maxChannels")]
public int MaxChannels { get; set; } = 65535;
[JsonPropertyName("maxBulkBanUsers")]
public int MaxBulkBanUsers { get; set; } = 200;
[JsonPropertyName("maxChannelsInCategory")]
public int MaxChannelsInCategory { get; set; } = 65536;
}
public class UserLimits {
[JsonPropertyName("maxGuilds")]
public int MaxGuilds { get; set; } = 1048576;
[JsonPropertyName("maxUsername")]
public int MaxUsername { get; set; } = 32;
[JsonPropertyName("maxFriends")]
public int MaxFriends { get; set; } = 5000;
[JsonPropertyName("maxBio")]
public int MaxBio { get; set; } = 190;
}
|