/
guild.ts
332 lines (309 loc) · 9.37 KB
/
guild.ts
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
/**
* Types extracted from https://discord.com/developers/docs/resources/guild
*/
import type { APIChannel } from './channel';
import type { APIEmoji } from './emoji';
import type { GatewayPresenceUpdate } from './gateway';
import type { APIRole } from './permissions';
import type { APIUser } from './user';
import type { GatewayVoiceState } from './voice';
/**
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIUnavailableGuild {
id: string;
unavailable: boolean;
}
/**
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
name: string;
icon: string | null;
splash: string | null;
banner?: string | null;
description?: string | null;
features?: GuildFeature[];
verification_level?: GuildVerificationLevel;
vanity_url_code?: string | null;
unavailable?: boolean;
}
/**
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIGuild extends APIPartialGuild {
discovery_splash: string | null;
owner?: boolean;
owner_id: string;
/**
* @deprecated Use `permissions_new` instead
*/
permissions?: number;
permissions_new?: string;
region: string;
afk_channel_id: string | null;
afk_timeout: number;
/**
* @deprecated Use `widget_enabled` instead
*/
embed_enabled?: boolean;
/**
* @deprecated Use `widget_channel_id` instead
*/
embed_channel_id?: string | null;
verification_level: GuildVerificationLevel;
default_message_notifications: GuildDefaultMessageNotifications;
explicit_content_filter: GuildExplicitContentFilter;
roles: APIRole[];
emojis: APIEmoji[];
features: GuildFeature[];
mfa_level: GuildMFALevel;
application_id: string | null;
widget_enabled?: boolean;
widget_channel_id?: string | null;
system_channel_id: string | null;
system_channel_flags: GuildSystemChannelFlags;
rules_channel_id: string | null;
joined_at?: string;
large?: boolean;
member_count?: number;
voice_states?: Omit<GatewayVoiceState, 'guild_id'>[];
members?: APIGuildMember[];
channels?: APIChannel[];
presences?: GatewayPresenceUpdate[];
max_presences?: number | null;
max_members?: number;
vanity_url_code: string | null;
description: string | null;
banner: string | null;
premium_tier: GuildPremiumTier;
premium_subscription_count?: number;
preferred_locale: string;
public_updates_channel_id: string | null;
max_video_channel_users?: number;
/**
* Returned by calling GET `/guilds/{guild.id}` with the query `with_counts` set to `true`
*/
approximate_member_count?: number;
/**
* Returned by calling GET `/guilds/{guild.id}` with the query `with_counts` set to `true`
*/
approximate_presence_count?: number;
welcome_screen?: APIGuildWelcomeScreen;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export enum GuildDefaultMessageNotifications {
ALL_MESSAGES,
ONLY_MENTIONS,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export enum GuildExplicitContentFilter {
DISABLED,
MEMBERS_WITHOUT_ROLES,
ALL_MEMBERS,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export enum GuildMFALevel {
NONE,
ELEVATED,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export enum GuildVerificationLevel {
NONE,
LOW,
MEDIUM,
HIGH,
VERY_HIGH,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export enum GuildPremiumTier {
NONE,
TIER_1,
TIER_2,
TIER_3,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export enum GuildSystemChannelFlags {
SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export enum GuildFeature {
ANIMATED_ICON = 'ANIMATED_ICON',
BANNER = 'BANNER',
COMMERCE = 'COMMERCE',
COMMUNITY = 'COMMUNITY',
DISCOVERABLE = 'DISCOVERABLE',
FEATURABLE = 'FEATURABLE',
INVITE_SPLASH = 'INVITE_SPLASH',
NEWS = 'NEWS',
PARTNERED = 'PARTNERED',
RELAY_ENABLED = 'RELAY_ENABLED',
VANITY_URL = 'VANITY_URL',
VERIFIED = 'VERIFIED',
VIP_REGIONS = 'VIP_REGIONS',
WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED',
}
/**
* https://discord.com/developers/docs/resources/guild#guild-preview-object
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIGuildPreview {
id: string;
name: string;
icon: string | null;
splash: string | null;
discovery_splash: string | null;
emojis: APIEmoji[];
features: GuildFeature[];
approximate_member_count: number;
approximate_presence_count: number;
}
/**
* @deprecated Use `APIGuildWidgetSettings` instead
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export type APIGuildWidget = APIGuildWidgetSettings;
/**
* https://discord.com/developers/docs/resources/guild#guild-widget-object
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIGuildWidgetSettings {
enabled: boolean;
channel_id: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIGuildMember {
user?: APIUser;
nick: string | null;
roles: string[];
joined_at: string;
premium_since?: string | null;
deaf: boolean;
mute: boolean;
}
/**
* https://discord.com/developers/docs/resources/guild#integration-object
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIGuildIntegration {
id: string;
name: string;
type: string;
enabled: boolean;
syncing: boolean;
role_id: string;
enable_emoticons?: boolean;
expire_behavior: IntegrationExpireBehavior;
expire_grace_period: number;
user?: APIUser;
account: APIIntegrationAccount;
synced_at: string;
subscriber_count: number;
revoked: boolean;
application?: APIGuildIntegrationApplication;
}
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export enum IntegrationExpireBehavior {
RemoveRole,
Kick,
}
/**
* https://discord.com/developers/docs/resources/guild#integration-account-object
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIIntegrationAccount {
id: string;
name: string;
}
/**
* https://discord.com/developers/docs/resources/guild#integration-application-object
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIGuildIntegrationApplication {
id: string;
name: string;
icon: string | null;
description: string;
summary: string;
bot?: APIUser;
}
/**
* https://discord.com/developers/docs/resources/guild#ban-object
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIBan {
reason: string | null;
user: APIUser;
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export enum GuildWidgetStyle {
Banner1 = 'banner1',
Banner2 = 'banner2',
Banner3 = 'banner3',
Banner4 = 'banner4',
Shield = 'shield',
}
/**
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIGuildWelcomeScreen {
description: string | null;
welcome_channels: APIGuildWelcomeScreenChannel[];
}
/**
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIGuildWelcomeScreenChannel {
channel_id: string;
emoji_id: string | null;
emoji_name: string | null;
}