@satorijs/adapter-discord 4.1.2 → 4.1.4
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 +2 -2
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -2
- package/lib/message.d.ts +2 -2
- package/lib/utils.d.ts +3 -3
- package/lib/ws.d.ts +2 -2
- package/package.json +7 -4
- package/src/bot.ts +221 -0
- package/src/index.ts +27 -0
- package/src/message.ts +446 -0
- package/src/types/.eslintrc.yml +2 -0
- package/src/types/application-role-connection.ts +61 -0
- package/src/types/application.ts +120 -0
- package/src/types/audit-log.ts +219 -0
- package/src/types/auto-moderation.ts +189 -0
- package/src/types/ban.ts +92 -0
- package/src/types/channel.ts +501 -0
- package/src/types/command.ts +320 -0
- package/src/types/component.ts +125 -0
- package/src/types/device.ts +44 -0
- package/src/types/emoji.ts +96 -0
- package/src/types/gateway.ts +334 -0
- package/src/types/guild-member.ts +260 -0
- package/src/types/guild-template.ts +109 -0
- package/src/types/guild.ts +476 -0
- package/src/types/index.ts +49 -0
- package/src/types/integration.ts +130 -0
- package/src/types/interaction.ts +283 -0
- package/src/types/internal.ts +44 -0
- package/src/types/invite.ts +192 -0
- package/src/types/message.ts +470 -0
- package/src/types/presence.ts +163 -0
- package/src/types/reaction.ts +139 -0
- package/src/types/role.ts +252 -0
- package/src/types/scheduled-event.ts +200 -0
- package/src/types/stage-instance.ts +98 -0
- package/src/types/sticker.ts +179 -0
- package/src/types/team.ts +33 -0
- package/src/types/thread.ts +298 -0
- package/src/types/user.ts +154 -0
- package/src/types/voice.ts +124 -0
- package/src/types/webhook.ts +246 -0
- package/src/utils.ts +391 -0
- package/src/ws.ts +124 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Guild, integer, Internal, snowflake, timestamp, User } from '.'
|
|
2
|
+
|
|
3
|
+
/** https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure */
|
|
4
|
+
export interface GuildTemplate {
|
|
5
|
+
/** the template code (unique ID) */
|
|
6
|
+
code: string
|
|
7
|
+
/** template name */
|
|
8
|
+
name: string
|
|
9
|
+
/** the description for the template */
|
|
10
|
+
description?: string
|
|
11
|
+
/** number of times this template has been used */
|
|
12
|
+
usage_count: integer
|
|
13
|
+
/** the ID of the user who created the template */
|
|
14
|
+
creator_id: snowflake
|
|
15
|
+
/** the user who created the template */
|
|
16
|
+
creator: User
|
|
17
|
+
/** when this template was created */
|
|
18
|
+
created_at: timestamp
|
|
19
|
+
/** when this template was last synced to the source guild */
|
|
20
|
+
updated_at: timestamp
|
|
21
|
+
/** the ID of the guild this template is based on */
|
|
22
|
+
source_guild_id: snowflake
|
|
23
|
+
/** the guild snapshot this template contains */
|
|
24
|
+
serialized_source_guild: Partial<Guild>
|
|
25
|
+
/** whether the template has unsynced changes */
|
|
26
|
+
is_dirty?: boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export namespace GuildTemplate {
|
|
30
|
+
/** https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template-json-params */
|
|
31
|
+
export interface CreateGuildParams {
|
|
32
|
+
/** name of the guild (2-100 characters) */
|
|
33
|
+
name: string
|
|
34
|
+
/** base64 128x128 image for the guild icon */
|
|
35
|
+
icon?: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** https://discord.com/developers/docs/resources/guild-template#create-guild-template-json-params */
|
|
39
|
+
export interface CreateParams {
|
|
40
|
+
/** name of the template (1-100 characters) */
|
|
41
|
+
name: string
|
|
42
|
+
/** description for the template (0-120 characters) */
|
|
43
|
+
description?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template-json-params */
|
|
47
|
+
export interface ModifyParams {
|
|
48
|
+
/** name of the template (1-100 characters) */
|
|
49
|
+
name?: string
|
|
50
|
+
/** description for the template (0-120 characters) */
|
|
51
|
+
description?: string
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare module './internal' {
|
|
56
|
+
interface Internal {
|
|
57
|
+
/**
|
|
58
|
+
* Returns a guild template object for the given code.
|
|
59
|
+
* @see https://discord.com/developers/docs/resources/guild-template#get-guild-template
|
|
60
|
+
*/
|
|
61
|
+
getGuildTemplate(code: string): Promise<GuildTemplate>
|
|
62
|
+
/**
|
|
63
|
+
* Create a new guild based on a template. Returns a guild object on success. Fires a Guild Create Gateway event.
|
|
64
|
+
* @see https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
|
|
65
|
+
*/
|
|
66
|
+
createGuildfromGuildTemplate(code: string, params: GuildTemplate.CreateGuildParams): Promise<Guild>
|
|
67
|
+
/**
|
|
68
|
+
* Returns an array of guild template objects. Requires the MANAGE_GUILD permission.
|
|
69
|
+
* @see https://discord.com/developers/docs/resources/guild-template#get-guild-templates
|
|
70
|
+
*/
|
|
71
|
+
getGuildTemplates(guild_id: snowflake): Promise<GuildTemplate[]>
|
|
72
|
+
/**
|
|
73
|
+
* Creates a template for the guild. Requires the MANAGE_GUILD permission. Returns the created guild template object on success.
|
|
74
|
+
* @see https://discord.com/developers/docs/resources/guild-template#create-guild-template
|
|
75
|
+
*/
|
|
76
|
+
createGuildTemplate(guild_id: snowflake, params: GuildTemplate.CreateParams): Promise<GuildTemplate>
|
|
77
|
+
/**
|
|
78
|
+
* Syncs the template to the guild's current state. Requires the MANAGE_GUILD permission. Returns the guild template object on success.
|
|
79
|
+
* @see https://discord.com/developers/docs/resources/guild-template#sync-guild-template
|
|
80
|
+
*/
|
|
81
|
+
syncGuildTemplate(guild_id: snowflake, code: string): Promise<GuildTemplate>
|
|
82
|
+
/**
|
|
83
|
+
* Modifies the template's metadata. Requires the MANAGE_GUILD permission. Returns the guild template object on success.
|
|
84
|
+
* @see https://discord.com/developers/docs/resources/guild-template#modify-guild-template
|
|
85
|
+
*/
|
|
86
|
+
modifyGuildTemplate(guild_id: snowflake, code: string, params: GuildTemplate.ModifyParams): Promise<GuildTemplate>
|
|
87
|
+
/**
|
|
88
|
+
* Deletes the template. Requires the MANAGE_GUILD permission. Returns the deleted guild template object on success.
|
|
89
|
+
* @see https://discord.com/developers/docs/resources/guild-template#delete-guild-template
|
|
90
|
+
*/
|
|
91
|
+
deleteGuildTemplate(guild_id: snowflake, code: string): Promise<GuildTemplate>
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
Internal.define({
|
|
96
|
+
'/guilds/templates/{template.code}': {
|
|
97
|
+
GET: 'getGuildTemplate',
|
|
98
|
+
POST: 'createGuildfromGuildTemplate',
|
|
99
|
+
},
|
|
100
|
+
'/guilds/{guild.id}/templates': {
|
|
101
|
+
GET: 'getGuildTemplates',
|
|
102
|
+
POST: 'createGuildTemplate',
|
|
103
|
+
},
|
|
104
|
+
'/guilds/{guild.id}/templates/{template.code}': {
|
|
105
|
+
PUT: 'syncGuildTemplate',
|
|
106
|
+
PATCH: 'modifyGuildTemplate',
|
|
107
|
+
DELETE: 'deleteGuildTemplate',
|
|
108
|
+
},
|
|
109
|
+
})
|
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import { Channel, Emoji, GuildMember, integer, Internal, Role, snowflake, Sticker, User } from '.'
|
|
2
|
+
|
|
3
|
+
/** https://discord.com/developers/docs/resources/guild#guild-object-guild-structure */
|
|
4
|
+
export interface Guild {
|
|
5
|
+
/** guild id */
|
|
6
|
+
id: snowflake
|
|
7
|
+
/** guild name (2-100 characters, excluding trailing and leading whitespace) */
|
|
8
|
+
name: string
|
|
9
|
+
/** icon hash */
|
|
10
|
+
icon?: string
|
|
11
|
+
/** icon hash, returned when in the template object */
|
|
12
|
+
icon_hash?: string
|
|
13
|
+
/** splash hash */
|
|
14
|
+
splash?: string
|
|
15
|
+
/** discovery splash hash; only present for guilds with the "DISCOVERABLE" feature */
|
|
16
|
+
discovery_splash?: string
|
|
17
|
+
/** true if the user is the owner of the guild */
|
|
18
|
+
owner?: boolean
|
|
19
|
+
/** id of owner */
|
|
20
|
+
owner_id: snowflake
|
|
21
|
+
/** total permissions for the user in the guild (excludes overwrites) */
|
|
22
|
+
permissions?: string
|
|
23
|
+
/** voice region id for the guild (deprecated) */
|
|
24
|
+
region?: string
|
|
25
|
+
/** id of afk channel */
|
|
26
|
+
afk_channel_id?: snowflake
|
|
27
|
+
/** afk timeout in seconds */
|
|
28
|
+
afk_timeout: integer
|
|
29
|
+
/** true if the server widget is enabled */
|
|
30
|
+
widget_enabled?: boolean
|
|
31
|
+
/** the channel id that the widget will generate an invite to, or null if set to no invite */
|
|
32
|
+
widget_channel_id?: snowflake
|
|
33
|
+
/** verification level required for the guild */
|
|
34
|
+
verification_level: integer
|
|
35
|
+
/** default message notifications level */
|
|
36
|
+
default_message_notifications: integer
|
|
37
|
+
/** explicit content filter level */
|
|
38
|
+
explicit_content_filter: integer
|
|
39
|
+
/** roles in the guild */
|
|
40
|
+
roles: Role[]
|
|
41
|
+
/** custom guild emojis */
|
|
42
|
+
emojis: Emoji[]
|
|
43
|
+
/** enabled guild features */
|
|
44
|
+
features: GuildFeature[]
|
|
45
|
+
/** required MFA level for the guild */
|
|
46
|
+
mfa_level: integer
|
|
47
|
+
/** application id of the guild creator if it is bot-created */
|
|
48
|
+
application_id?: snowflake
|
|
49
|
+
/** the id of the channel where guild notices such as welcome messages and boost events are posted */
|
|
50
|
+
system_channel_id?: snowflake
|
|
51
|
+
/** system channel flags */
|
|
52
|
+
system_channel_flags: integer
|
|
53
|
+
/** the id of the channel where Community guilds can display rules and/or guidelines */
|
|
54
|
+
rules_channel_id?: snowflake
|
|
55
|
+
/** the maximum number of presences for the guild (null is always returned, apart from the largest of guilds) */
|
|
56
|
+
max_presences?: integer
|
|
57
|
+
/** the maximum number of members for the guild */
|
|
58
|
+
max_members?: integer
|
|
59
|
+
/** the vanity url code for the guild */
|
|
60
|
+
vanity_url_code?: string
|
|
61
|
+
/** the description of a Community guild */
|
|
62
|
+
description?: string
|
|
63
|
+
/** banner hash */
|
|
64
|
+
banner?: string
|
|
65
|
+
/** premium tier (Server Boost level) */
|
|
66
|
+
premium_tier: integer
|
|
67
|
+
/** the number of boosts this guild currently has */
|
|
68
|
+
premium_subscription_count?: integer
|
|
69
|
+
/** the preferred locale of a Community guild; used in server discovery and notices from Discord; defaults to "en-US" */
|
|
70
|
+
preferred_locale: string
|
|
71
|
+
/** the id of the channel where admins and moderators of Community guilds receive notices from Discord */
|
|
72
|
+
public_updates_channel_id?: snowflake
|
|
73
|
+
/** the maximum amount of users in a video channel */
|
|
74
|
+
max_video_channel_users?: integer
|
|
75
|
+
/** approximate number of members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true */
|
|
76
|
+
approximate_member_count?: integer
|
|
77
|
+
/** approximate number of non-offline members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true */
|
|
78
|
+
approximate_presence_count?: integer
|
|
79
|
+
/** the welcome screen of a Community guild, shown to new members, returned in an Invite's guild object */
|
|
80
|
+
welcome_screen?: WelcomeScreen
|
|
81
|
+
/** guild NSFW level */
|
|
82
|
+
nsfw_level: integer
|
|
83
|
+
/** custom guild stickers */
|
|
84
|
+
stickers?: Sticker[]
|
|
85
|
+
/** whether the guild has the boost progress bar enabled */
|
|
86
|
+
premium_progress_bar_enabled: boolean
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export namespace Guild {
|
|
90
|
+
export namespace Event {
|
|
91
|
+
export interface Create extends Guild {}
|
|
92
|
+
|
|
93
|
+
export interface Update extends Guild {}
|
|
94
|
+
|
|
95
|
+
export interface Delete extends Guild {}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export namespace Params {
|
|
99
|
+
/** https://discord.com/developers/docs/resources/user#get-current-user-guilds-query-string-params */
|
|
100
|
+
export interface List {
|
|
101
|
+
/** get guilds before this guild ID */
|
|
102
|
+
before?: snowflake
|
|
103
|
+
/** get guilds after this guild ID */
|
|
104
|
+
after?: snowflake
|
|
105
|
+
/** max number of guilds to return (1-200) */
|
|
106
|
+
limit?: integer
|
|
107
|
+
/** include approximate member and presence counts in response */
|
|
108
|
+
with_counts?: boolean
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** https://discord.com/developers/docs/resources/guild#create-guild-json-params */
|
|
112
|
+
export interface Create {
|
|
113
|
+
/** name of the guild (2-100 characters) */
|
|
114
|
+
name: string
|
|
115
|
+
/** voice region id (deprecated) */
|
|
116
|
+
region?: string
|
|
117
|
+
/** base64 128x128 image for the guild icon */
|
|
118
|
+
icon?: string
|
|
119
|
+
/** verification level */
|
|
120
|
+
verification_level?: integer
|
|
121
|
+
/** default message notification level */
|
|
122
|
+
default_message_notifications?: integer
|
|
123
|
+
/** explicit content filter level */
|
|
124
|
+
explicit_content_filter?: integer
|
|
125
|
+
/** new guild roles */
|
|
126
|
+
roles?: Role[]
|
|
127
|
+
/** new guild's channels */
|
|
128
|
+
channels?: Partial<Channel>[]
|
|
129
|
+
/** id for afk channel */
|
|
130
|
+
afk_channel_id?: snowflake
|
|
131
|
+
/** afk timeout in seconds */
|
|
132
|
+
afk_timeout?: integer
|
|
133
|
+
/** the id of the channel where guild notices such as welcome messages and boost events are posted */
|
|
134
|
+
system_channel_id?: snowflake
|
|
135
|
+
/** system channel flags */
|
|
136
|
+
system_channel_flags?: integer
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** https://discord.com/developers/docs/resources/guild#get-guild-query-string-params */
|
|
140
|
+
export interface Get {
|
|
141
|
+
/** when true, will return approximate member and presence counts for the guild */
|
|
142
|
+
with_counts?: boolean
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** https://discord.com/developers/docs/resources/guild#modify-guild-json-params */
|
|
146
|
+
export interface Modify {
|
|
147
|
+
/** guild name */
|
|
148
|
+
name: string
|
|
149
|
+
/** guild voice region id (deprecated) */
|
|
150
|
+
region?: string
|
|
151
|
+
/** verification level */
|
|
152
|
+
verification_level?: integer
|
|
153
|
+
/** default message notification level */
|
|
154
|
+
default_message_notifications?: integer
|
|
155
|
+
/** explicit content filter level */
|
|
156
|
+
explicit_content_filter?: integer
|
|
157
|
+
/** id for afk channel */
|
|
158
|
+
afk_channel_id?: snowflake
|
|
159
|
+
/** afk timeout in seconds */
|
|
160
|
+
afk_timeout: integer
|
|
161
|
+
/** base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature) */
|
|
162
|
+
icon?: string
|
|
163
|
+
/** user id to transfer guild ownership to (must be owner) */
|
|
164
|
+
owner_id: snowflake
|
|
165
|
+
/** base64 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature) */
|
|
166
|
+
splash?: string
|
|
167
|
+
/** base64 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature) */
|
|
168
|
+
discovery_splash?: string
|
|
169
|
+
/** base64 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature) */
|
|
170
|
+
banner?: string
|
|
171
|
+
/** the id of the channel where guild notices such as welcome messages and boost events are posted */
|
|
172
|
+
system_channel_id?: snowflake
|
|
173
|
+
/** system channel flags */
|
|
174
|
+
system_channel_flags: integer
|
|
175
|
+
/** the id of the channel where Community guilds display rules and/or guidelines */
|
|
176
|
+
rules_channel_id?: snowflake
|
|
177
|
+
/** the id of the channel where admins and moderators of Community guilds receive notices from Discord */
|
|
178
|
+
public_updates_channel_id?: snowflake
|
|
179
|
+
/** the preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US" */
|
|
180
|
+
preferred_locale?: string
|
|
181
|
+
/** enabled guild features */
|
|
182
|
+
features: GuildFeature[]
|
|
183
|
+
/** the description for the guild, if the guild is discoverable */
|
|
184
|
+
description?: string
|
|
185
|
+
/** whether the guild's boost progress bar should be enabled. */
|
|
186
|
+
premium_progress_bar_enabled: boolean
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-query-string-params */
|
|
190
|
+
export interface GetWidgetImage {
|
|
191
|
+
/** style of the widget image returned (see below) */
|
|
192
|
+
style: WidgetStyleOptions
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options */
|
|
196
|
+
export enum WidgetStyleOptions {
|
|
197
|
+
/** shield style widget with Discord icon and guild members online count */
|
|
198
|
+
shield = 'shield',
|
|
199
|
+
/** large image with guild icon, name and online count. "POWERED BY DISCORD" as the footer of the widget */
|
|
200
|
+
banner1 = 'banner1',
|
|
201
|
+
/** smaller widget style with guild icon, name and online count. Split on the right with Discord logo */
|
|
202
|
+
banner2 = 'banner2',
|
|
203
|
+
/** large image with guild icon, name and online count. In the footer, Discord logo on the left and "Chat Now" on the right */
|
|
204
|
+
banner3 = 'banner3',
|
|
205
|
+
/** 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 */
|
|
206
|
+
banner4 = 'banner4',
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen-json-params */
|
|
210
|
+
export interface ModifyWelcomeScreen {
|
|
211
|
+
/** whether the welcome screen is enabled */
|
|
212
|
+
enabled: boolean
|
|
213
|
+
/** channels linked in the welcome screen and their display options */
|
|
214
|
+
welcome_channels: WelcomeScreenChannel[]
|
|
215
|
+
/** the server description to show in the welcome screen */
|
|
216
|
+
description: string
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags */
|
|
222
|
+
export enum SystemChannelFlag {
|
|
223
|
+
/** Suppress member join notifications */
|
|
224
|
+
SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,
|
|
225
|
+
/** Suppress server boost notifications */
|
|
226
|
+
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,
|
|
227
|
+
/** Suppress server setup tips */
|
|
228
|
+
SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 1 << 2,
|
|
229
|
+
/** Hide member join sticker reply buttons */
|
|
230
|
+
SUPPRESS_JOIN_NOTIFICATION_REPLIES = 1 << 3,
|
|
231
|
+
/** Suppress role subscription purchase and renewal notifications */
|
|
232
|
+
SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS = 1 << 4,
|
|
233
|
+
/** Hide role subscription sticker reply buttons */
|
|
234
|
+
SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES = 1 << 5
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** https://discord.com/developers/docs/resources/guild#guild-object-guild-features */
|
|
238
|
+
export 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
|
+
|
|
285
|
+
/** https://discord.com/developers/docs/resources/guild#guild-preview-object-guild-preview-structure */
|
|
286
|
+
export interface GuildPreview {
|
|
287
|
+
/** guild id */
|
|
288
|
+
id: snowflake
|
|
289
|
+
/** guild name (2-100 characters) */
|
|
290
|
+
name: string
|
|
291
|
+
/** icon hash */
|
|
292
|
+
icon?: string
|
|
293
|
+
/** splash hash */
|
|
294
|
+
splash?: string
|
|
295
|
+
/** discovery splash hash */
|
|
296
|
+
discovery_splash?: string
|
|
297
|
+
/** custom guild emojis */
|
|
298
|
+
emojis: Emoji[]
|
|
299
|
+
/** enabled guild features */
|
|
300
|
+
features: GuildFeature[]
|
|
301
|
+
/** approximate number of members in this guild */
|
|
302
|
+
approximate_member_count: integer
|
|
303
|
+
/** approximate number of online members in this guild */
|
|
304
|
+
approximate_presence_count: integer
|
|
305
|
+
/** the description for the guild, if the guild is discoverable */
|
|
306
|
+
description?: string
|
|
307
|
+
/** custom guild stickers */
|
|
308
|
+
stickers: Sticker[]
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */
|
|
312
|
+
export interface GuildWidget {
|
|
313
|
+
/** guild id */
|
|
314
|
+
id: snowflake
|
|
315
|
+
/** guild name (2-100 characters) */
|
|
316
|
+
name: string
|
|
317
|
+
/** instant invite for the guilds specified widget invite channel */
|
|
318
|
+
instant_invite?: string
|
|
319
|
+
/** voice and stage channels which are accessible by everyone */
|
|
320
|
+
channels: Partial<Channel>[]
|
|
321
|
+
/** special widget user objects that includes users presence (Limit 100) */
|
|
322
|
+
members: Partial<User>[]
|
|
323
|
+
/** number of online members in this guild */
|
|
324
|
+
presence_count: integer
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-structure */
|
|
328
|
+
export interface WelcomeScreen {
|
|
329
|
+
/** the server description shown in the welcome screen */
|
|
330
|
+
description?: string
|
|
331
|
+
/** the channels shown in the welcome screen, up to 5 */
|
|
332
|
+
welcome_channels: WelcomeScreenChannel[]
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-channel-structure */
|
|
336
|
+
export interface WelcomeScreenChannel {
|
|
337
|
+
/** the channel's id */
|
|
338
|
+
channel_id: snowflake
|
|
339
|
+
/** the description shown for the channel */
|
|
340
|
+
description: string
|
|
341
|
+
/** the emoji id, if the emoji is custom */
|
|
342
|
+
emoji_id?: snowflake
|
|
343
|
+
/** the emoji name if custom, the unicode character if standard, or null if no emoji is set */
|
|
344
|
+
emoji_name?: string
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
declare module './gateway' {
|
|
348
|
+
interface GatewayEvents {
|
|
349
|
+
/** lazy-load for unavailable guild, guild became available, or user joined a new guild */
|
|
350
|
+
GUILD_CREATE: Guild.Event.Create
|
|
351
|
+
/** guild was updated */
|
|
352
|
+
GUILD_UPDATE: Guild.Event.Update
|
|
353
|
+
/** guild became unavailable, or user left/was removed from a guild */
|
|
354
|
+
GUILD_DELETE: Guild.Event.Delete
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
declare module './internal' {
|
|
359
|
+
interface Internal {
|
|
360
|
+
/**
|
|
361
|
+
* Returns a list of partial guild objects the current user is a member of. Requires the guilds OAuth2 scope.
|
|
362
|
+
* @see https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
|
363
|
+
*/
|
|
364
|
+
getCurrentUserGuilds(params?: Guild.Params.List): Promise<Guild[]>
|
|
365
|
+
/**
|
|
366
|
+
* Returns a guild member object for the current user. Requires the guilds.members.read OAuth2 scope.
|
|
367
|
+
* @see https://discord.com/developers/docs/resources/user#get-current-user-guild-member
|
|
368
|
+
*/
|
|
369
|
+
getCurrentUserGuildMember(guild_id: snowflake): Promise<GuildMember>
|
|
370
|
+
/**
|
|
371
|
+
* Leave a guild. Returns a 204 empty response on success.
|
|
372
|
+
* @see https://discord.com/developers/docs/resources/user#leave-guild
|
|
373
|
+
*/
|
|
374
|
+
leaveGuild(guild_id: snowflake): Promise<void>
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
Internal.define({
|
|
379
|
+
'/users/@me/guilds': {
|
|
380
|
+
GET: 'getCurrentUserGuilds',
|
|
381
|
+
},
|
|
382
|
+
'/users/@me/guilds/{guild.id}/member': {
|
|
383
|
+
GET: 'getCurrentUserGuildMember',
|
|
384
|
+
},
|
|
385
|
+
'/users/@me/guilds/{guild.id}': {
|
|
386
|
+
DELETE: 'leaveGuild',
|
|
387
|
+
},
|
|
388
|
+
})
|
|
389
|
+
|
|
390
|
+
declare module './internal' {
|
|
391
|
+
interface Internal {
|
|
392
|
+
/**
|
|
393
|
+
* Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event.
|
|
394
|
+
* @see https://discord.com/developers/docs/resources/guild#create-guild
|
|
395
|
+
*/
|
|
396
|
+
createGuild(params: Guild.Params.Create): Promise<Guild>
|
|
397
|
+
/**
|
|
398
|
+
* 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.
|
|
399
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild
|
|
400
|
+
*/
|
|
401
|
+
getGuild(guild_id: snowflake, params?: Guild.Params.Get): Promise<Guild>
|
|
402
|
+
/**
|
|
403
|
+
* Returns the guild preview object for the given id. If the user is not in the guild, then the guild must be lurkable.
|
|
404
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-preview
|
|
405
|
+
*/
|
|
406
|
+
getGuildPreview(guild_id: snowflake): Promise<GuildPreview>
|
|
407
|
+
/**
|
|
408
|
+
* Modify a guild's settings. Requires the MANAGE_GUILD permission. Returns the updated guild object on success. Fires a Guild Update Gateway event.
|
|
409
|
+
* @see https://discord.com/developers/docs/resources/guild#modify-guild
|
|
410
|
+
*/
|
|
411
|
+
modifyGuild(guild_id: snowflake, params: Guild.Params.Modify): Promise<void>
|
|
412
|
+
/**
|
|
413
|
+
* Delete a guild permanently. User must be owner. Returns 204 No Content on success. Fires a Guild Delete Gateway event.
|
|
414
|
+
* @see https://discord.com/developers/docs/resources/guild#delete-guild
|
|
415
|
+
*/
|
|
416
|
+
deleteGuild(guild_id: snowflake): Promise<void>
|
|
417
|
+
/**
|
|
418
|
+
* Returns a guild widget object. Requires the MANAGE_GUILD permission.
|
|
419
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-widget-settings
|
|
420
|
+
*/
|
|
421
|
+
getGuildWidgetSettings(guild_id: snowflake): Promise<GuildWidget>
|
|
422
|
+
/**
|
|
423
|
+
* 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.
|
|
424
|
+
* @see https://discord.com/developers/docs/resources/guild#modify-guild-widget
|
|
425
|
+
*/
|
|
426
|
+
modifyGuildWidget(guild_id: snowflake, params: Partial<GuildWidget>): Promise<GuildWidget>
|
|
427
|
+
/**
|
|
428
|
+
* Returns the widget for the guild.
|
|
429
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-widget
|
|
430
|
+
*/
|
|
431
|
+
getGuildWidget(guild_id: snowflake): Promise<any>
|
|
432
|
+
/**
|
|
433
|
+
* Returns a PNG image widget for the guild. Requires no permissions or authentication.
|
|
434
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-widget-image
|
|
435
|
+
*/
|
|
436
|
+
getGuildWidgetImage(guild_id: snowflake, params?: Guild.Params.GetWidgetImage): Promise<any>
|
|
437
|
+
/**
|
|
438
|
+
* Returns the Welcome Screen object for the guild.
|
|
439
|
+
* @see https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
|
440
|
+
*/
|
|
441
|
+
getGuildWelcomeScreen(guild_id: snowflake): Promise<WelcomeScreen>
|
|
442
|
+
/**
|
|
443
|
+
* Modify the guild's Welcome Screen. Requires the MANAGE_GUILD permission. Returns the updated Welcome Screen object.
|
|
444
|
+
* @see https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
|
445
|
+
*/
|
|
446
|
+
modifyGuildWelcomeScreen(guild_id: snowflake, params: Guild.Params.ModifyWelcomeScreen): Promise<WelcomeScreen>
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
Internal.define({
|
|
451
|
+
'/guilds': {
|
|
452
|
+
POST: 'createGuild',
|
|
453
|
+
},
|
|
454
|
+
'/guilds/{guild.id}': {
|
|
455
|
+
GET: 'getGuild',
|
|
456
|
+
PATCH: 'modifyGuild',
|
|
457
|
+
DELETE: 'deleteGuild',
|
|
458
|
+
},
|
|
459
|
+
'/guilds/{guild.id}/preview': {
|
|
460
|
+
GET: 'getGuildPreview',
|
|
461
|
+
},
|
|
462
|
+
'/guilds/{guild.id}/widget': {
|
|
463
|
+
GET: 'getGuildWidgetSettings',
|
|
464
|
+
PATCH: 'modifyGuildWidget',
|
|
465
|
+
},
|
|
466
|
+
'/guilds/{guild.id}/widget.json': {
|
|
467
|
+
GET: 'getGuildWidget',
|
|
468
|
+
},
|
|
469
|
+
'/guilds/{guild.id}/widget.png': {
|
|
470
|
+
GET: 'getGuildWidgetImage',
|
|
471
|
+
},
|
|
472
|
+
'/guilds/{guild.id}/welcome-screen': {
|
|
473
|
+
GET: 'getGuildWelcomeScreen',
|
|
474
|
+
PATCH: 'modifyGuildWelcomeScreen',
|
|
475
|
+
},
|
|
476
|
+
})
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Last updated: Jan 24, 2023
|
|
2
|
+
|
|
3
|
+
export * from './internal'
|
|
4
|
+
|
|
5
|
+
export * from './application'
|
|
6
|
+
export * from './application-role-connection'
|
|
7
|
+
export * from './audit-log'
|
|
8
|
+
export * from './auto-moderation'
|
|
9
|
+
export * from './ban'
|
|
10
|
+
export * from './channel'
|
|
11
|
+
export * from './command'
|
|
12
|
+
export * from './component'
|
|
13
|
+
export * from './device'
|
|
14
|
+
export * from './emoji'
|
|
15
|
+
export * from './gateway'
|
|
16
|
+
export * from './guild-member'
|
|
17
|
+
export * from './guild-template'
|
|
18
|
+
export * from './guild'
|
|
19
|
+
export * from './integration'
|
|
20
|
+
export * from './interaction'
|
|
21
|
+
export * from './invite'
|
|
22
|
+
export * from './message'
|
|
23
|
+
export * from './presence'
|
|
24
|
+
export * from './reaction'
|
|
25
|
+
export * from './role'
|
|
26
|
+
export * from './scheduled-event'
|
|
27
|
+
export * from './stage-instance'
|
|
28
|
+
export * from './sticker'
|
|
29
|
+
export * from './team'
|
|
30
|
+
export * from './thread'
|
|
31
|
+
export * from './user'
|
|
32
|
+
export * from './voice'
|
|
33
|
+
export * from './webhook'
|
|
34
|
+
|
|
35
|
+
export type integer = number
|
|
36
|
+
export type snowflake = string
|
|
37
|
+
export type timestamp = string
|
|
38
|
+
|
|
39
|
+
/** @see https://discord.com/developers/docs/reference#locales */
|
|
40
|
+
export type Locale = typeof Locale[number]
|
|
41
|
+
|
|
42
|
+
export const Locale = [
|
|
43
|
+
'da', 'de', 'en-GB', 'en-US', 'es-ES',
|
|
44
|
+
'fr', 'hr', 'it', 'lt', 'hu',
|
|
45
|
+
'nl', 'no', 'pl', 'pt-BR', 'ro',
|
|
46
|
+
'fi', 'sv-SE', 'vi', 'tr', 'cs',
|
|
47
|
+
'el', 'bg', 'ru', 'uk', 'hi',
|
|
48
|
+
'th', 'zh-CN', 'ja', 'zh-TW', 'ko',
|
|
49
|
+
] as const
|