@satorijs/adapter-discord 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bot.d.ts +39 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +1557 -0
- package/lib/index.js.map +7 -0
- package/lib/sender.d.ts +36 -0
- package/lib/types/application.d.ts +84 -0
- package/lib/types/audit-log.d.ts +128 -0
- package/lib/types/ban.d.ts +67 -0
- package/lib/types/channel.d.ts +368 -0
- package/lib/types/command.d.ts +214 -0
- package/lib/types/component.d.ts +84 -0
- package/lib/types/emoji.d.ts +63 -0
- package/lib/types/gateway.d.ts +248 -0
- package/lib/types/guild-member.d.ts +216 -0
- package/lib/types/guild-template.d.ts +88 -0
- package/lib/types/guild.d.ts +419 -0
- package/lib/types/index.d.ts +31 -0
- package/lib/types/integration.d.ts +111 -0
- package/lib/types/interaction.d.ts +182 -0
- package/lib/types/internal.d.ts +9 -0
- package/lib/types/invite.d.ts +163 -0
- package/lib/types/message.d.ts +404 -0
- package/lib/types/presence.d.ts +151 -0
- package/lib/types/reaction.d.ts +114 -0
- package/lib/types/role.d.ts +221 -0
- package/lib/types/scheduled-event.d.ts +167 -0
- package/lib/types/stage-instance.d.ts +78 -0
- package/lib/types/sticker.d.ts +149 -0
- package/lib/types/team.d.ts +30 -0
- package/lib/types/thread.d.ts +201 -0
- package/lib/types/user.d.ts +122 -0
- package/lib/types/voice.d.ts +102 -0
- package/lib/types/webhook.d.ts +199 -0
- package/lib/utils.d.ts +11 -0
- package/lib/ws.d.ts +24 -0
- package/package.json +42 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { Channel, Emoji, GuildMember, integer, PresenceUpdateEvent, Role, snowflake, StageInstance, Sticker, timestamp, VoiceState } from '.';
|
|
2
|
+
/** https://discord.com/developers/docs/resources/guild#guild-object-guild-structure */
|
|
3
|
+
export interface Guild {
|
|
4
|
+
/** guild id */
|
|
5
|
+
id: snowflake;
|
|
6
|
+
/** guild name (2-100 characters, excluding trailing and leading whitespace) */
|
|
7
|
+
name: string;
|
|
8
|
+
/** icon hash */
|
|
9
|
+
icon?: string;
|
|
10
|
+
/** icon hash, returned when in the template object */
|
|
11
|
+
icon_hash?: string;
|
|
12
|
+
/** splash hash */
|
|
13
|
+
splash?: string;
|
|
14
|
+
/** discovery splash hash; only present for guilds with the "DISCOVERABLE" feature */
|
|
15
|
+
discovery_splash?: string;
|
|
16
|
+
/** true if the user is the owner of the guild */
|
|
17
|
+
owner?: boolean;
|
|
18
|
+
/** id of owner */
|
|
19
|
+
owner_id: snowflake;
|
|
20
|
+
/** total permissions for the user in the guild (excludes overwrites) */
|
|
21
|
+
permissions?: string;
|
|
22
|
+
/** voice region id for the guild (deprecated) */
|
|
23
|
+
region?: string;
|
|
24
|
+
/** id of afk channel */
|
|
25
|
+
afk_channel_id?: snowflake;
|
|
26
|
+
/** afk timeout in seconds */
|
|
27
|
+
afk_timeout: integer;
|
|
28
|
+
/** true if the server widget is enabled */
|
|
29
|
+
widget_enabled?: boolean;
|
|
30
|
+
/** the channel id that the widget will generate an invite to, or null if set to no invite */
|
|
31
|
+
widget_channel_id?: snowflake;
|
|
32
|
+
/** verification level required for the guild */
|
|
33
|
+
verification_level: integer;
|
|
34
|
+
/** default message notifications level */
|
|
35
|
+
default_message_notifications: integer;
|
|
36
|
+
/** explicit content filter level */
|
|
37
|
+
explicit_content_filter: integer;
|
|
38
|
+
/** roles in the guild */
|
|
39
|
+
roles: Role[];
|
|
40
|
+
/** custom guild emojis */
|
|
41
|
+
emojis: Emoji[];
|
|
42
|
+
/** enabled guild features */
|
|
43
|
+
features: GuildFeature[];
|
|
44
|
+
/** required MFA level for the guild */
|
|
45
|
+
mfa_level: integer;
|
|
46
|
+
/** application id of the guild creator if it is bot-created */
|
|
47
|
+
application_id?: snowflake;
|
|
48
|
+
/** the id of the channel where guild notices such as welcome messages and boost events are posted */
|
|
49
|
+
system_channel_id?: snowflake;
|
|
50
|
+
/** system channel flags */
|
|
51
|
+
system_channel_flags: integer;
|
|
52
|
+
/** the id of the channel where Community guilds can display rules and/or guidelines */
|
|
53
|
+
rules_channel_id?: snowflake;
|
|
54
|
+
/** when this guild was joined at */
|
|
55
|
+
joined_at?: timestamp;
|
|
56
|
+
/** true if this is considered a large guild */
|
|
57
|
+
large?: boolean;
|
|
58
|
+
/** true if this guild is unavailable due to an outage */
|
|
59
|
+
unavailable?: boolean;
|
|
60
|
+
/** total number of members in this guild */
|
|
61
|
+
member_count?: integer;
|
|
62
|
+
/** states of members currently in voice channels; lacks the guild_id key */
|
|
63
|
+
voice_states?: Partial<VoiceState>[];
|
|
64
|
+
/** users in the guild */
|
|
65
|
+
members?: GuildMember[];
|
|
66
|
+
/** channels in the guild */
|
|
67
|
+
channels?: Channel[];
|
|
68
|
+
/** all active threads in the guild that current user has permission to view */
|
|
69
|
+
threads?: Channel[];
|
|
70
|
+
/** presences of the members in the guild, will only include non-offline members if the size is greater than large threshold */
|
|
71
|
+
presences?: Partial<PresenceUpdateEvent>[];
|
|
72
|
+
/** the maximum number of presences for the guild (null is always returned, apart from the largest of guilds) */
|
|
73
|
+
max_presences?: integer;
|
|
74
|
+
/** the maximum number of members for the guild */
|
|
75
|
+
max_members?: integer;
|
|
76
|
+
/** the vanity url code for the guild */
|
|
77
|
+
vanity_url_code?: string;
|
|
78
|
+
/** the description of a Community guild */
|
|
79
|
+
description?: string;
|
|
80
|
+
/** banner hash */
|
|
81
|
+
banner?: string;
|
|
82
|
+
/** premium tier (Server Boost level) */
|
|
83
|
+
premium_tier: integer;
|
|
84
|
+
/** the number of boosts this guild currently has */
|
|
85
|
+
premium_subscription_count?: integer;
|
|
86
|
+
/** the preferred locale of a Community guild; used in server discovery and notices from Discord; defaults to "en-US" */
|
|
87
|
+
preferred_locale: string;
|
|
88
|
+
/** the id of the channel where admins and moderators of Community guilds receive notices from Discord */
|
|
89
|
+
public_updates_channel_id?: snowflake;
|
|
90
|
+
/** the maximum amount of users in a video channel */
|
|
91
|
+
max_video_channel_users?: integer;
|
|
92
|
+
/** approximate number of members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true */
|
|
93
|
+
approximate_member_count?: integer;
|
|
94
|
+
/** approximate number of non-offline members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true */
|
|
95
|
+
approximate_presence_count?: integer;
|
|
96
|
+
/** the welcome screen of a Community guild, shown to new members, returned in an Invite's guild object */
|
|
97
|
+
welcome_screen?: WelcomeScreen;
|
|
98
|
+
/** guild NSFW level */
|
|
99
|
+
nsfw_level: integer;
|
|
100
|
+
/** Stage instances in the guild */
|
|
101
|
+
stage_instances?: StageInstance[];
|
|
102
|
+
/** custom guild stickers */
|
|
103
|
+
stickers?: Sticker[];
|
|
104
|
+
}
|
|
105
|
+
export declare namespace Guild {
|
|
106
|
+
namespace Event {
|
|
107
|
+
interface Create extends Guild {
|
|
108
|
+
}
|
|
109
|
+
interface Update extends Guild {
|
|
110
|
+
}
|
|
111
|
+
interface Delete extends Guild {
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
namespace Params {
|
|
115
|
+
/** https://discord.com/developers/docs/resources/user#get-current-user-guilds-query-string-params */
|
|
116
|
+
interface List {
|
|
117
|
+
/** get guilds before this guild ID */
|
|
118
|
+
before: snowflake;
|
|
119
|
+
/** get guilds after this guild ID */
|
|
120
|
+
after: snowflake;
|
|
121
|
+
/** max number of guilds to return (1-200) */
|
|
122
|
+
limit: integer;
|
|
123
|
+
}
|
|
124
|
+
/** https://discord.com/developers/docs/resources/guild#create-guild-json-params */
|
|
125
|
+
interface Create {
|
|
126
|
+
/** name of the guild (2-100 characters) */
|
|
127
|
+
name: string;
|
|
128
|
+
/** voice region id (deprecated) */
|
|
129
|
+
region?: string;
|
|
130
|
+
/** base64 128x128 image for the guild icon */
|
|
131
|
+
icon?: string;
|
|
132
|
+
/** verification level */
|
|
133
|
+
verification_level?: integer;
|
|
134
|
+
/** default message notification level */
|
|
135
|
+
default_message_notifications?: integer;
|
|
136
|
+
/** explicit content filter level */
|
|
137
|
+
explicit_content_filter?: integer;
|
|
138
|
+
/** new guild roles */
|
|
139
|
+
roles?: Role[];
|
|
140
|
+
/** new guild's channels */
|
|
141
|
+
channels?: Partial<Channel>[];
|
|
142
|
+
/** id for afk channel */
|
|
143
|
+
afk_channel_id?: snowflake;
|
|
144
|
+
/** afk timeout in seconds */
|
|
145
|
+
afk_timeout?: integer;
|
|
146
|
+
/** the id of the channel where guild notices such as welcome messages and boost events are posted */
|
|
147
|
+
system_channel_id?: snowflake;
|
|
148
|
+
/** system channel flags */
|
|
149
|
+
system_channel_flags?: integer;
|
|
150
|
+
}
|
|
151
|
+
/** https://discord.com/developers/docs/resources/guild#get-guild-query-string-params */
|
|
152
|
+
interface Get {
|
|
153
|
+
/** when true, will return approximate member and presence counts for the guild */
|
|
154
|
+
with_counts?: boolean;
|
|
155
|
+
}
|
|
156
|
+
/** https://discord.com/developers/docs/resources/guild#modify-guild-json-params */
|
|
157
|
+
interface Modify {
|
|
158
|
+
/** guild name */
|
|
159
|
+
name: string;
|
|
160
|
+
/** guild voice region id (deprecated) */
|
|
161
|
+
region?: string;
|
|
162
|
+
/** verification level */
|
|
163
|
+
verification_level?: integer;
|
|
164
|
+
/** default message notification level */
|
|
165
|
+
default_message_notifications?: integer;
|
|
166
|
+
/** explicit content filter level */
|
|
167
|
+
explicit_content_filter?: integer;
|
|
168
|
+
/** id for afk channel */
|
|
169
|
+
afk_channel_id?: snowflake;
|
|
170
|
+
/** afk timeout in seconds */
|
|
171
|
+
afk_timeout: integer;
|
|
172
|
+
/** base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature) */
|
|
173
|
+
icon?: string;
|
|
174
|
+
/** user id to transfer guild ownership to (must be owner) */
|
|
175
|
+
owner_id: snowflake;
|
|
176
|
+
/** base64 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature) */
|
|
177
|
+
splash?: string;
|
|
178
|
+
/** base64 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature) */
|
|
179
|
+
discovery_splash?: string;
|
|
180
|
+
/** base64 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature) */
|
|
181
|
+
banner?: string;
|
|
182
|
+
/** the id of the channel where guild notices such as welcome messages and boost events are posted */
|
|
183
|
+
system_channel_id?: snowflake;
|
|
184
|
+
/** system channel flags */
|
|
185
|
+
system_channel_flags: integer;
|
|
186
|
+
/** the id of the channel where Community guilds display rules and/or guidelines */
|
|
187
|
+
rules_channel_id?: snowflake;
|
|
188
|
+
/** the id of the channel where admins and moderators of Community guilds receive notices from Discord */
|
|
189
|
+
public_updates_channel_id?: snowflake;
|
|
190
|
+
/** the preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US" */
|
|
191
|
+
preferred_locale?: string;
|
|
192
|
+
/** enabled guild features */
|
|
193
|
+
features: GuildFeature[];
|
|
194
|
+
/** the description for the guild, if the guild is discoverable */
|
|
195
|
+
description?: string;
|
|
196
|
+
/** whether the guild's boost progress bar should be enabled. */
|
|
197
|
+
premium_progress_bar_enabled: boolean;
|
|
198
|
+
}
|
|
199
|
+
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-query-string-params */
|
|
200
|
+
interface GetWidgetImage {
|
|
201
|
+
/** style of the widget image returned (see below) */
|
|
202
|
+
style: WidgetStyleOptions;
|
|
203
|
+
}
|
|
204
|
+
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options */
|
|
205
|
+
enum WidgetStyleOptions {
|
|
206
|
+
/** shield style widget with Discord icon and guild members online count */
|
|
207
|
+
shield = "shield",
|
|
208
|
+
/** large image with guild icon, name and online count. "POWERED BY DISCORD" as the footer of the widget */
|
|
209
|
+
banner1 = "banner1",
|
|
210
|
+
/** smaller widget style with guild icon, name and online count. Split on the right with Discord logo */
|
|
211
|
+
banner2 = "banner2",
|
|
212
|
+
/** large image with guild icon, name and online count. In the footer, Discord logo on the left and "Chat Now" on the right */
|
|
213
|
+
banner3 = "banner3",
|
|
214
|
+
/** large Discord logo at the top of the widget. Guild icon, name and online count in the middle portion of the widget and a "JOIN MY SERVER" button at the bottom */
|
|
215
|
+
banner4 = "banner4"
|
|
216
|
+
}
|
|
217
|
+
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen-json-params */
|
|
218
|
+
interface ModifyWelcomeScreen {
|
|
219
|
+
/** whether the welcome screen is enabled */
|
|
220
|
+
enabled: boolean;
|
|
221
|
+
/** channels linked in the welcome screen and their display options */
|
|
222
|
+
welcome_channels: WelcomeScreenChannel[];
|
|
223
|
+
/** the server description to show in the welcome screen */
|
|
224
|
+
description: string;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/** https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags */
|
|
229
|
+
export declare enum SystemChannelFlag {
|
|
230
|
+
/** Suppress member join notifications */
|
|
231
|
+
SUPPRESS_JOIN_NOTIFICATIONS = 1,
|
|
232
|
+
/** Suppress server boost notifications */
|
|
233
|
+
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 2,
|
|
234
|
+
/** Suppress server setup tips */
|
|
235
|
+
SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 4
|
|
236
|
+
}
|
|
237
|
+
/** https://discord.com/developers/docs/resources/guild#guild-object-guild-features */
|
|
238
|
+
export declare enum GuildFeature {
|
|
239
|
+
/** guild has access to set an animated guild icon */
|
|
240
|
+
ANIMATED_ICON = "ANIMATED_ICON",
|
|
241
|
+
/** guild has access to set a guild banner image */
|
|
242
|
+
BANNER = "BANNER",
|
|
243
|
+
/** guild has access to use commerce features (i.e. create store channels) */
|
|
244
|
+
COMMERCE = "COMMERCE",
|
|
245
|
+
/** guild can enable welcome screen, Membership Screening, stage channels and discovery, and receives community updates */
|
|
246
|
+
COMMUNITY = "COMMUNITY",
|
|
247
|
+
/** guild is able to be discovered in the directory */
|
|
248
|
+
DISCOVERABLE = "DISCOVERABLE",
|
|
249
|
+
/** guild is able to be featured in the directory */
|
|
250
|
+
FEATURABLE = "FEATURABLE",
|
|
251
|
+
/** guild has access to set an invite splash background */
|
|
252
|
+
INVITE_SPLASH = "INVITE_SPLASH",
|
|
253
|
+
/** guild has enabled Membership Screening */
|
|
254
|
+
MEMBER_VERIFICATION_GATE_ENABLED = "MEMBER_VERIFICATION_GATE_ENABLED",
|
|
255
|
+
/** guild has enabled monetization */
|
|
256
|
+
MONETIZATION_ENABLED = "MONETIZATION_ENABLED",
|
|
257
|
+
/** guild has increased custom sticker slots */
|
|
258
|
+
MORE_STICKERS = "MORE_STICKERS",
|
|
259
|
+
/** guild has access to create news channels */
|
|
260
|
+
NEWS = "NEWS",
|
|
261
|
+
/** guild is partnered */
|
|
262
|
+
PARTNERED = "PARTNERED",
|
|
263
|
+
/** guild can be previewed before joining via Membership Screening or the directory */
|
|
264
|
+
PREVIEW_ENABLED = "PREVIEW_ENABLED",
|
|
265
|
+
/** guild has access to create private threads */
|
|
266
|
+
PRIVATE_THREADS = "PRIVATE_THREADS",
|
|
267
|
+
/** guild is able to set role icons */
|
|
268
|
+
ROLE_ICONS = "ROLE_ICONS",
|
|
269
|
+
/** guild has access to the seven day archive time for threads */
|
|
270
|
+
SEVEN_DAY_THREAD_ARCHIVE = "SEVEN_DAY_THREAD_ARCHIVE",
|
|
271
|
+
/** guild has access to the three day archive time for threads */
|
|
272
|
+
THREE_DAY_THREAD_ARCHIVE = "THREE_DAY_THREAD_ARCHIVE",
|
|
273
|
+
/** guild has enabled ticketed events */
|
|
274
|
+
TICKETED_EVENTS_ENABLED = "TICKETED_EVENTS_ENABLED",
|
|
275
|
+
/** guild has access to set a vanity URL */
|
|
276
|
+
VANITY_URL = "VANITY_URL",
|
|
277
|
+
/** guild is verified */
|
|
278
|
+
VERIFIED = "VERIFIED",
|
|
279
|
+
/** guild has access to set 384kbps bitrate in voice (previously VIP voice servers) */
|
|
280
|
+
VIP_REGIONS = "VIP_REGIONS",
|
|
281
|
+
/** guild has enabled the welcome screen */
|
|
282
|
+
WELCOME_SCREEN_ENABLED = "WELCOME_SCREEN_ENABLED"
|
|
283
|
+
}
|
|
284
|
+
/** https://discord.com/developers/docs/resources/guild#guild-preview-object-guild-preview-structure */
|
|
285
|
+
export interface GuildPreview {
|
|
286
|
+
/** guild id */
|
|
287
|
+
id: snowflake;
|
|
288
|
+
/** guild name (2-100 characters) */
|
|
289
|
+
name: string;
|
|
290
|
+
/** icon hash */
|
|
291
|
+
icon?: string;
|
|
292
|
+
/** splash hash */
|
|
293
|
+
splash?: string;
|
|
294
|
+
/** discovery splash hash */
|
|
295
|
+
discovery_splash?: string;
|
|
296
|
+
/** custom guild emojis */
|
|
297
|
+
emojis: Emoji[];
|
|
298
|
+
/** enabled guild features */
|
|
299
|
+
features: GuildFeature[];
|
|
300
|
+
/** approximate number of members in this guild */
|
|
301
|
+
approximate_member_count: integer;
|
|
302
|
+
/** approximate number of online members in this guild */
|
|
303
|
+
approximate_presence_count: integer;
|
|
304
|
+
/** the description for the guild, if the guild is discoverable */
|
|
305
|
+
description?: string;
|
|
306
|
+
}
|
|
307
|
+
/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */
|
|
308
|
+
export interface GuildWidget {
|
|
309
|
+
/** whether the widget is enabled */
|
|
310
|
+
enabled: boolean;
|
|
311
|
+
/** the widget channel id */
|
|
312
|
+
channel_id?: snowflake;
|
|
313
|
+
}
|
|
314
|
+
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-structure */
|
|
315
|
+
export interface WelcomeScreen {
|
|
316
|
+
/** the server description shown in the welcome screen */
|
|
317
|
+
description?: string;
|
|
318
|
+
/** the channels shown in the welcome screen, up to 5 */
|
|
319
|
+
welcome_channels: WelcomeScreenChannel[];
|
|
320
|
+
}
|
|
321
|
+
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-channel-structure */
|
|
322
|
+
export interface WelcomeScreenChannel {
|
|
323
|
+
/** the channel's id */
|
|
324
|
+
channel_id: snowflake;
|
|
325
|
+
/** the description shown for the channel */
|
|
326
|
+
description: string;
|
|
327
|
+
/** the emoji id, if the emoji is custom */
|
|
328
|
+
emoji_id?: snowflake;
|
|
329
|
+
/** the emoji name if custom, the unicode character if standard, or null if no emoji is set */
|
|
330
|
+
emoji_name?: string;
|
|
331
|
+
}
|
|
332
|
+
declare module './gateway' {
|
|
333
|
+
interface GatewayEvents {
|
|
334
|
+
/** lazy-load for unavailable guild, guild became available, or user joined a new guild */
|
|
335
|
+
GUILD_CREATE: Guild.Event.Create;
|
|
336
|
+
/** guild was updated */
|
|
337
|
+
GUILD_UPDATE: Guild.Event.Update;
|
|
338
|
+
/** guild became unavailable, or user left/was removed from a guild */
|
|
339
|
+
GUILD_DELETE: Guild.Event.Delete;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
declare module './internal' {
|
|
343
|
+
interface Internal {
|
|
344
|
+
/**
|
|
345
|
+
* Returns a list of partial guild objects the current user is a member of. Requires the guilds OAuth2 scope.
|
|
346
|
+
* @see https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
|
347
|
+
*/
|
|
348
|
+
getCurrentUserGuilds(params?: Guild.Params.List): Promise<Guild[]>;
|
|
349
|
+
/**
|
|
350
|
+
* Returns a guild member object for the current user. Requires the guilds.members.read OAuth2 scope.
|
|
351
|
+
* @see https://discord.com/developers/docs/resources/user#get-current-user-guild-member
|
|
352
|
+
*/
|
|
353
|
+
getCurrentUserGuildMember(guild_id: snowflake): Promise<GuildMember>;
|
|
354
|
+
/**
|
|
355
|
+
* Leave a guild. Returns a 204 empty response on success.
|
|
356
|
+
* @see https://discord.com/developers/docs/resources/user#leave-guild
|
|
357
|
+
*/
|
|
358
|
+
leaveGuild(guild_id: snowflake): Promise<void>;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
declare module './internal' {
|
|
362
|
+
interface Internal {
|
|
363
|
+
/**
|
|
364
|
+
* Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event.
|
|
365
|
+
* @see https://discord.com/developers/docs/resources/guild#create-guild
|
|
366
|
+
*/
|
|
367
|
+
createGuild(params: Guild.Params.Create): Promise<Guild>;
|
|
368
|
+
/**
|
|
369
|
+
* Returns the guild object for the given id. If with_counts is set to true, this endpoint will also return approximate_member_count and approximate_presence_count for the guild.
|
|
370
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild
|
|
371
|
+
*/
|
|
372
|
+
getGuild(guild_id: snowflake, params?: Guild.Params.Get): Promise<Guild>;
|
|
373
|
+
/**
|
|
374
|
+
* Returns the guild preview object for the given id. If the user is not in the guild, then the guild must be lurkable.
|
|
375
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-preview
|
|
376
|
+
*/
|
|
377
|
+
getGuildPreview(guild_id: snowflake): Promise<GuildPreview>;
|
|
378
|
+
/**
|
|
379
|
+
* Modify a guild's settings. Requires the MANAGE_GUILD permission. Returns the updated guild object on success. Fires a Guild Update Gateway event.
|
|
380
|
+
* @see https://discord.com/developers/docs/resources/guild#modify-guild
|
|
381
|
+
*/
|
|
382
|
+
modifyGuild(guild_id: snowflake, params: Guild.Params.Modify): Promise<void>;
|
|
383
|
+
/**
|
|
384
|
+
* Delete a guild permanently. User must be owner. Returns 204 No Content on success. Fires a Guild Delete Gateway event.
|
|
385
|
+
* @see https://discord.com/developers/docs/resources/guild#delete-guild
|
|
386
|
+
*/
|
|
387
|
+
deleteGuild(guild_id: snowflake): Promise<void>;
|
|
388
|
+
/**
|
|
389
|
+
* Returns a guild widget object. Requires the MANAGE_GUILD permission.
|
|
390
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-widget-settings
|
|
391
|
+
*/
|
|
392
|
+
getGuildWidgetSettings(guild_id: snowflake): Promise<GuildWidget>;
|
|
393
|
+
/**
|
|
394
|
+
* Modify a guild widget object for the guild. All attributes may be passed in with JSON and modified. Requires the MANAGE_GUILD permission. Returns the updated guild widget object.
|
|
395
|
+
* @see https://discord.com/developers/docs/resources/guild#modify-guild-widget
|
|
396
|
+
*/
|
|
397
|
+
modifyGuildWidget(guild_id: snowflake, params: Partial<GuildWidget>): Promise<GuildWidget>;
|
|
398
|
+
/**
|
|
399
|
+
* Returns the widget for the guild.
|
|
400
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-widget
|
|
401
|
+
*/
|
|
402
|
+
getGuildWidget(guild_id: snowflake): Promise<any>;
|
|
403
|
+
/**
|
|
404
|
+
* Returns a PNG image widget for the guild. Requires no permissions or authentication.
|
|
405
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-widget-image
|
|
406
|
+
*/
|
|
407
|
+
getGuildWidgetImage(guild_id: snowflake, params?: Guild.Params.GetWidgetImage): Promise<any>;
|
|
408
|
+
/**
|
|
409
|
+
* Returns the Welcome Screen object for the guild.
|
|
410
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
|
411
|
+
*/
|
|
412
|
+
getGuildWelcomeScreen(guild_id: snowflake): Promise<WelcomeScreen>;
|
|
413
|
+
/**
|
|
414
|
+
* Modify the guild's Welcome Screen. Requires the MANAGE_GUILD permission. Returns the updated Welcome Screen object.
|
|
415
|
+
* @see https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
|
416
|
+
*/
|
|
417
|
+
modifyGuildWelcomeScreen(guild_id: snowflake, params: Guild.Params.ModifyWelcomeScreen): Promise<WelcomeScreen>;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from './internal';
|
|
2
|
+
export * from './application';
|
|
3
|
+
export * from './audit-log';
|
|
4
|
+
export * from './ban';
|
|
5
|
+
export * from './channel';
|
|
6
|
+
export * from './command';
|
|
7
|
+
export * from './component';
|
|
8
|
+
export * from './device';
|
|
9
|
+
export * from './emoji';
|
|
10
|
+
export * from './gateway';
|
|
11
|
+
export * from './guild-member';
|
|
12
|
+
export * from './guild-template';
|
|
13
|
+
export * from './guild';
|
|
14
|
+
export * from './integration';
|
|
15
|
+
export * from './interaction';
|
|
16
|
+
export * from './invite';
|
|
17
|
+
export * from './message';
|
|
18
|
+
export * from './presence';
|
|
19
|
+
export * from './reaction';
|
|
20
|
+
export * from './role';
|
|
21
|
+
export * from './scheduled-event';
|
|
22
|
+
export * from './stage-instance';
|
|
23
|
+
export * from './sticker';
|
|
24
|
+
export * from './team';
|
|
25
|
+
export * from './thread';
|
|
26
|
+
export * from './user';
|
|
27
|
+
export * from './voice';
|
|
28
|
+
export * from './webhook';
|
|
29
|
+
export declare type integer = number;
|
|
30
|
+
export declare type snowflake = string;
|
|
31
|
+
export declare type timestamp = string;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { integer, snowflake, timestamp, User } from '.';
|
|
2
|
+
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */
|
|
3
|
+
export interface Integration {
|
|
4
|
+
/** integration id */
|
|
5
|
+
id: snowflake;
|
|
6
|
+
/** integration name */
|
|
7
|
+
name: string;
|
|
8
|
+
/** integration type (twitch, youtube, or discord) */
|
|
9
|
+
type: string;
|
|
10
|
+
/** is this integration enabled */
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
/** is this integration syncing */
|
|
13
|
+
syncing?: boolean;
|
|
14
|
+
/** id that this integration uses for "subscribers" */
|
|
15
|
+
role_id?: snowflake;
|
|
16
|
+
/** whether emoticons should be synced for this integration (twitch only currently) */
|
|
17
|
+
enable_emoticons?: boolean;
|
|
18
|
+
/** the behavior of expiring subscribers */
|
|
19
|
+
expire_behavior?: IntegrationExpireBehavior;
|
|
20
|
+
/** the grace period (in days) before expiring subscribers */
|
|
21
|
+
expire_grace_period?: integer;
|
|
22
|
+
/** user for this integration */
|
|
23
|
+
user?: User;
|
|
24
|
+
/** integration account information */
|
|
25
|
+
account: IntegrationAccount;
|
|
26
|
+
/** when this integration was last synced */
|
|
27
|
+
synced_at?: timestamp;
|
|
28
|
+
/** how many subscribers this integration has */
|
|
29
|
+
subscriber_count?: integer;
|
|
30
|
+
/** has this integration been revoked */
|
|
31
|
+
revoked?: boolean;
|
|
32
|
+
/** The bot/OAuth2 application for discord integrations */
|
|
33
|
+
application?: IntegrationApplication;
|
|
34
|
+
}
|
|
35
|
+
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors */
|
|
36
|
+
export declare enum IntegrationExpireBehavior {
|
|
37
|
+
REMOVE_ROLE = 0,
|
|
38
|
+
KICK = 1
|
|
39
|
+
}
|
|
40
|
+
/** https://discord.com/developers/docs/resources/guild#integration-account-object-integration-account-structure */
|
|
41
|
+
export interface IntegrationAccount {
|
|
42
|
+
/** id of the account */
|
|
43
|
+
id: string;
|
|
44
|
+
/** name of the account */
|
|
45
|
+
name: string;
|
|
46
|
+
}
|
|
47
|
+
/** https://discord.com/developers/docs/resources/guild#integration-application-object-integration-application-structure */
|
|
48
|
+
export interface IntegrationApplication {
|
|
49
|
+
/** the id of the app */
|
|
50
|
+
id: snowflake;
|
|
51
|
+
/** the name of the app */
|
|
52
|
+
name: string;
|
|
53
|
+
/** the icon hash of the app */
|
|
54
|
+
icon?: string;
|
|
55
|
+
/** the description of the app */
|
|
56
|
+
description: string;
|
|
57
|
+
/** the summary of the app */
|
|
58
|
+
summary: string;
|
|
59
|
+
/** the bot associated with this application */
|
|
60
|
+
bot?: User;
|
|
61
|
+
}
|
|
62
|
+
/** https://discord.com/developers/docs/topics/gateway#guild-integrations-update-guild-integrations-update-event-fields */
|
|
63
|
+
export interface GuildIntegrationsUpdateEvent {
|
|
64
|
+
/** id of the guild whose integrations were updated */
|
|
65
|
+
guild_id: snowflake;
|
|
66
|
+
}
|
|
67
|
+
/** https://discord.com/developers/docs/topics/gateway#integration-create-integration-create-event-additional-fields */
|
|
68
|
+
export interface IntegrationCreateEvent extends Integration {
|
|
69
|
+
/** id of the guild */
|
|
70
|
+
guild_id: snowflake;
|
|
71
|
+
}
|
|
72
|
+
/** https://discord.com/developers/docs/topics/gateway#integration-update-integration-update-event-additional-fields */
|
|
73
|
+
export interface IntegrationUpdateEvent extends Integration {
|
|
74
|
+
/** id of the guild */
|
|
75
|
+
guild_id: snowflake;
|
|
76
|
+
}
|
|
77
|
+
/** https://discord.com/developers/docs/topics/gateway#integration-delete-integration-delete-event-fields */
|
|
78
|
+
export interface IntegrationDeleteEvent {
|
|
79
|
+
/** integration id */
|
|
80
|
+
id: snowflake;
|
|
81
|
+
/** id of the guild */
|
|
82
|
+
guild_id: snowflake;
|
|
83
|
+
/** id of the bot/OAuth2 application for this discord integration */
|
|
84
|
+
application_id?: snowflake;
|
|
85
|
+
}
|
|
86
|
+
declare module './gateway' {
|
|
87
|
+
interface GatewayEvents {
|
|
88
|
+
/** guild integration was updated */
|
|
89
|
+
GUILD_INTEGRATIONS_UPDATE: GuildIntegrationsUpdateEvent;
|
|
90
|
+
/** guild integration was created */
|
|
91
|
+
INTEGRATION_CREATE: IntegrationCreateEvent;
|
|
92
|
+
/** guild integration was updated */
|
|
93
|
+
INTEGRATION_UPDATE: IntegrationUpdateEvent;
|
|
94
|
+
/** guild integration was deleted */
|
|
95
|
+
INTEGRATION_DELETE: IntegrationDeleteEvent;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
declare module './internal' {
|
|
99
|
+
interface Internal {
|
|
100
|
+
/**
|
|
101
|
+
* Returns a list of integration objects for the guild. Requires the MANAGE_GUILD permission.
|
|
102
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-integrations
|
|
103
|
+
*/
|
|
104
|
+
getGuildIntegrations(guild_id: snowflake): Promise<Integration[]>;
|
|
105
|
+
/**
|
|
106
|
+
* Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one. Requires the MANAGE_GUILD permission. Returns a 204 empty response on success. Fires a Guild Integrations Update Gateway event.
|
|
107
|
+
* @see https://discord.com/developers/docs/resources/guild#delete-guild-integration
|
|
108
|
+
*/
|
|
109
|
+
deleteGuildIntegration(guild_id: snowflake, integration_id: snowflake): Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
}
|