disgroove 1.2.9 → 1.3.0-dev.19adbb0
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/dist/Client.d.ts +40 -40
- package/dist/Client.js +75 -75
- package/dist/Client.js.map +1 -1
- package/dist/gateway/Shard.js +30 -34
- package/dist/gateway/Shard.js.map +1 -1
- package/dist/rest/RequestsManager.js +1 -1
- package/dist/rest/RequestsManager.js.map +1 -1
- package/dist/structures/Application.d.ts +70 -70
- package/dist/structures/Application.js +128 -155
- package/dist/structures/Application.js.map +1 -1
- package/dist/structures/ApplicationCommand.d.ts +4 -4
- package/dist/structures/ApplicationCommand.js +19 -19
- package/dist/structures/ApplicationCommand.js.map +1 -1
- package/dist/structures/AutoModerationRule.d.ts +2 -2
- package/dist/structures/AutoModerationRule.js +7 -7
- package/dist/structures/AutoModerationRule.js.map +1 -1
- package/dist/structures/Channel.d.ts +126 -126
- package/dist/structures/Channel.js +258 -258
- package/dist/structures/Channel.js.map +1 -1
- package/dist/structures/Emoji.d.ts +2 -2
- package/dist/structures/Emoji.js +9 -9
- package/dist/structures/Emoji.js.map +1 -1
- package/dist/structures/Entitlement.d.ts +24 -0
- package/dist/structures/Entitlement.js +68 -0
- package/dist/structures/Entitlement.js.map +1 -0
- package/dist/structures/Guild.d.ts +305 -305
- package/dist/structures/Guild.js +616 -624
- package/dist/structures/Guild.js.map +1 -1
- package/dist/structures/GuildMember.d.ts +9 -9
- package/dist/structures/GuildMember.js +30 -30
- package/dist/structures/GuildMember.js.map +1 -1
- package/dist/structures/GuildScheduledEvent.d.ts +2 -2
- package/dist/structures/GuildScheduledEvent.js +5 -5
- package/dist/structures/GuildScheduledEvent.js.map +1 -1
- package/dist/structures/GuildTemplate.d.ts +4 -4
- package/dist/structures/GuildTemplate.js +9 -9
- package/dist/structures/GuildTemplate.js.map +1 -1
- package/dist/structures/Integration.js +2 -2
- package/dist/structures/Integration.js.map +1 -1
- package/dist/structures/Interaction.d.ts +27 -27
- package/dist/structures/Interaction.js +90 -83
- package/dist/structures/Interaction.js.map +1 -1
- package/dist/structures/Invite.js +1 -1
- package/dist/structures/Invite.js.map +1 -1
- package/dist/structures/Message.d.ts +20 -17
- package/dist/structures/Message.js +81 -55
- package/dist/structures/Message.js.map +1 -1
- package/dist/structures/PartialApplication.d.ts +70 -70
- package/dist/structures/PartialApplication.js +128 -155
- package/dist/structures/PartialApplication.js.map +1 -1
- package/dist/structures/Role.d.ts +2 -2
- package/dist/structures/Role.js +7 -7
- package/dist/structures/Role.js.map +1 -1
- package/dist/structures/SKU.d.ts +23 -0
- package/dist/structures/SKU.js +63 -0
- package/dist/structures/SKU.js.map +1 -0
- package/dist/structures/StageInstance.d.ts +2 -2
- package/dist/structures/StageInstance.js +7 -7
- package/dist/structures/StageInstance.js.map +1 -1
- package/dist/structures/Sticker.d.ts +2 -2
- package/dist/structures/Sticker.js +9 -9
- package/dist/structures/Sticker.js.map +1 -1
- package/dist/structures/Team.js +2 -2
- package/dist/structures/Team.js.map +1 -1
- package/dist/structures/TestEntitlement.d.ts +23 -0
- package/dist/structures/TestEntitlement.js +61 -0
- package/dist/structures/TestEntitlement.js.map +1 -0
- package/dist/structures/UnavailableGuild.d.ts +305 -305
- package/dist/structures/UnavailableGuild.js +609 -610
- package/dist/structures/UnavailableGuild.js.map +1 -1
- package/dist/structures/User.d.ts +11 -11
- package/dist/structures/User.js +35 -34
- package/dist/structures/User.js.map +1 -1
- package/dist/structures/Webhook.d.ts +26 -26
- package/dist/structures/Webhook.js +115 -147
- package/dist/structures/Webhook.js.map +1 -1
- package/dist/structures/index.d.ts +3 -0
- package/dist/structures/index.js +3 -0
- package/dist/structures/index.js.map +1 -1
- package/dist/types/interaction.d.ts +12 -12
- package/dist/types/message-components.d.ts +4 -4
- package/dist/utils/Util.d.ts +8 -482
- package/dist/utils/Util.js +169 -150
- package/dist/utils/Util.js.map +1 -1
- package/package.json +1 -1
|
@@ -106,7 +106,7 @@ class Channel extends _1.Base {
|
|
|
106
106
|
joinTimestamp: data.member.join_timestamp,
|
|
107
107
|
flags: data.member.flags,
|
|
108
108
|
member: data.member.member !== undefined
|
|
109
|
-
? new _1.GuildMember(data.member.member, this.client)
|
|
109
|
+
? new _1.GuildMember(data.member.member, this.client).toJSON()
|
|
110
110
|
: undefined,
|
|
111
111
|
};
|
|
112
112
|
if (data.default_auto_archive_duration !== undefined)
|
|
@@ -131,8 +131,8 @@ class Channel extends _1.Base {
|
|
|
131
131
|
this.defaultReactionEmoji =
|
|
132
132
|
data.default_reaction_emoji !== null
|
|
133
133
|
? {
|
|
134
|
-
emojiId: data.default_reaction_emoji
|
|
135
|
-
emojiName: data.default_reaction_emoji
|
|
134
|
+
emojiId: data.default_reaction_emoji.emoji_id,
|
|
135
|
+
emojiName: data.default_reaction_emoji.emoji_name,
|
|
136
136
|
}
|
|
137
137
|
: null;
|
|
138
138
|
if (data.default_thread_rate_limit_per_user !== undefined)
|
|
@@ -145,59 +145,42 @@ class Channel extends _1.Base {
|
|
|
145
145
|
if (data.newly_created !== undefined)
|
|
146
146
|
this.newlyCreated = data.newly_created;
|
|
147
147
|
}
|
|
148
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
/** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient */
|
|
149
|
+
addRecipient(userId, options) {
|
|
150
|
+
this.client.rest.put(rest_1.Endpoints.channelRecipient(this.id, userId), {
|
|
151
151
|
json: {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
position: options.position,
|
|
155
|
-
topic: options.topic,
|
|
156
|
-
nsfw: options.nsfw,
|
|
157
|
-
rate_limit_per_user: options.rateLimitPerUser,
|
|
158
|
-
bitrate: options.bitrate,
|
|
159
|
-
permission_overwrites: options.permissionOverwrites,
|
|
160
|
-
parent_id: options.parentId,
|
|
161
|
-
rtc_region: options.rtcRegion,
|
|
162
|
-
video_quality_mode: options.videoQualityMode,
|
|
163
|
-
default_auto_archive_duration: options.defaultAutoArchiveDuration,
|
|
164
|
-
flags: options.flags,
|
|
165
|
-
available_tags: options.availableTags,
|
|
166
|
-
default_reaction_emoji: options.defaultReactionEmoji,
|
|
167
|
-
default_thread_rate_limit_per_user: options.defaultThreadRateLimitPerUser,
|
|
168
|
-
default_sort_order: options.defaultSortOrder,
|
|
169
|
-
default_forum_layout: options.defaultForumLayout,
|
|
170
|
-
archived: options.archived,
|
|
171
|
-
auto_archive_duration: options.autoArchiveDuration,
|
|
172
|
-
locked: options.locked,
|
|
173
|
-
invitable: options.invitable,
|
|
174
|
-
applied_tags: options.appliedTags,
|
|
152
|
+
access_token: options.accessToken,
|
|
153
|
+
nick: options.nick,
|
|
175
154
|
},
|
|
176
|
-
|
|
177
|
-
}), this.client);
|
|
155
|
+
});
|
|
178
156
|
}
|
|
179
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
reason,
|
|
183
|
-
}), this.client).toJSON();
|
|
157
|
+
/** https://discord.com/developers/docs/resources/channel#add-thread-member */
|
|
158
|
+
addThreadMember(userId) {
|
|
159
|
+
this.client.rest.put(rest_1.Endpoints.threadMembers(this.id, userId));
|
|
184
160
|
}
|
|
185
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
around: options.around,
|
|
191
|
-
before: options.before,
|
|
192
|
-
after: options.after,
|
|
193
|
-
limit: options.limit,
|
|
161
|
+
/** https://discord.com/developers/docs/resources/channel#bulk-delete-messages */
|
|
162
|
+
bulkDeleteMessages(options, reason) {
|
|
163
|
+
this.client.rest.post(rest_1.Endpoints.channelBulkDelete(this.id), {
|
|
164
|
+
json: {
|
|
165
|
+
messages: options?.messagesIds,
|
|
194
166
|
},
|
|
195
|
-
|
|
196
|
-
|
|
167
|
+
reason,
|
|
168
|
+
});
|
|
197
169
|
}
|
|
198
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
199
|
-
async
|
|
200
|
-
return new _1.
|
|
170
|
+
/** https://discord.com/developers/docs/resources/channel#create-channel-invite */
|
|
171
|
+
async createInvite(options, reason) {
|
|
172
|
+
return new _1.Invite(await this.client.rest.post(rest_1.Endpoints.channelInvites(this.id), {
|
|
173
|
+
json: {
|
|
174
|
+
max_age: options.maxAge,
|
|
175
|
+
max_uses: options.maxUses,
|
|
176
|
+
temporary: options.temporary,
|
|
177
|
+
unique: options.unique,
|
|
178
|
+
target_type: options.targetType,
|
|
179
|
+
target_user_id: options.targetUserId,
|
|
180
|
+
target_application_id: options.targetApplicationId,
|
|
181
|
+
},
|
|
182
|
+
reason,
|
|
183
|
+
}), this.client);
|
|
201
184
|
}
|
|
202
185
|
/** https://discord.com/developers/docs/resources/channel#create-message */
|
|
203
186
|
async createMessage(options) {
|
|
@@ -226,33 +209,135 @@ class Channel extends _1.Base {
|
|
|
226
209
|
files: options.files,
|
|
227
210
|
}), this.client);
|
|
228
211
|
}
|
|
229
|
-
/** https://discord.com/developers/docs/resources/channel#crosspost-message */
|
|
230
|
-
async crosspostMessage(messageId) {
|
|
231
|
-
return new _1.Message(await this.client.rest.post(rest_1.Endpoints.channelMessage(this.id, messageId)), this.client);
|
|
232
|
-
}
|
|
233
212
|
/** https://discord.com/developers/docs/resources/channel#create-reaction */
|
|
234
213
|
createReaction(messageId, emoji) {
|
|
235
214
|
this.client.rest.put(rest_1.Endpoints.channelMessageReaction(this.id, messageId, emoji));
|
|
236
215
|
}
|
|
237
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
238
|
-
|
|
239
|
-
this.client.rest.
|
|
216
|
+
/** https://discord.com/developers/docs/resources/channel#start-thread-from-message */
|
|
217
|
+
async createThreadFromMessage(messageId, options, reason) {
|
|
218
|
+
return new Channel(await this.client.rest.post(rest_1.Endpoints.threads(this.id, messageId), {
|
|
219
|
+
json: {
|
|
220
|
+
name: options.name,
|
|
221
|
+
auto_archive_duration: options.autoArchiveDuration,
|
|
222
|
+
rate_limit_per_user: options.rateLimitPerUser,
|
|
223
|
+
},
|
|
224
|
+
reason,
|
|
225
|
+
}), this.client);
|
|
240
226
|
}
|
|
241
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
242
|
-
async
|
|
243
|
-
return this.client.rest
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
227
|
+
/** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel */
|
|
228
|
+
async createThreadInForumOrMediaChannel(options, reason) {
|
|
229
|
+
return new Channel(await this.client.rest.post(rest_1.Endpoints.threads(this.id), {
|
|
230
|
+
json: {
|
|
231
|
+
name: options.name,
|
|
232
|
+
auto_archive_duration: options.autoArchiveDuration,
|
|
233
|
+
rate_limit_per_user: options.rateLimitPerUser,
|
|
234
|
+
message: {
|
|
235
|
+
content: options.message.content,
|
|
236
|
+
embeds: options.message.embeds,
|
|
237
|
+
flags: options.message.flags,
|
|
238
|
+
allowed_mentions: {
|
|
239
|
+
parse: options.message.allowedMentions?.parse,
|
|
240
|
+
roles: options.message.allowedMentions?.roles,
|
|
241
|
+
users: options.message.allowedMentions?.users,
|
|
242
|
+
replied_user: options.message.allowedMentions?.repliedUser,
|
|
243
|
+
},
|
|
244
|
+
components: options.message.components !== undefined
|
|
245
|
+
? options.message.components !== null
|
|
246
|
+
? this.client.util.messageComponentToRaw(options.message.components)
|
|
247
|
+
: null
|
|
248
|
+
: undefined,
|
|
249
|
+
attachments: options.message.attachments,
|
|
250
|
+
},
|
|
251
|
+
applied_tags: options.appliedTags,
|
|
248
252
|
},
|
|
249
|
-
|
|
250
|
-
|
|
253
|
+
files: options.files,
|
|
254
|
+
reason,
|
|
255
|
+
}), this.client);
|
|
256
|
+
}
|
|
257
|
+
/** https://discord.com/developers/docs/resources/channel#start-thread-without-message */
|
|
258
|
+
async createThreadWithoutMessage(options, reason) {
|
|
259
|
+
return new Channel(await this.client.rest.post(rest_1.Endpoints.threads(this.id), {
|
|
260
|
+
json: {
|
|
261
|
+
name: options.name,
|
|
262
|
+
auto_archive_duration: options.autoArchiveDuration,
|
|
263
|
+
type: options.type,
|
|
264
|
+
invitable: options.invitable,
|
|
265
|
+
rate_limit_per_user: options.rateLimitPerUser,
|
|
266
|
+
},
|
|
267
|
+
reason,
|
|
268
|
+
}), this.client);
|
|
269
|
+
}
|
|
270
|
+
/** https://discord.com/developers/docs/resources/webhook#create-webhook */
|
|
271
|
+
async createWebhook(options, reason) {
|
|
272
|
+
return new _1.Webhook(await this.client.rest.post(rest_1.Endpoints.channelWebhooks(this.id), {
|
|
273
|
+
json: {
|
|
274
|
+
name: options.name,
|
|
275
|
+
avatar: options.avatar,
|
|
276
|
+
},
|
|
277
|
+
reason,
|
|
278
|
+
}), this.client);
|
|
279
|
+
}
|
|
280
|
+
/** https://discord.com/developers/docs/resources/channel#crosspost-message */
|
|
281
|
+
async crosspostMessage(messageId) {
|
|
282
|
+
return new _1.Message(await this.client.rest.post(rest_1.Endpoints.channelMessage(this.id, messageId)), this.client);
|
|
283
|
+
}
|
|
284
|
+
/** https://discord.com/developers/docs/resources/channel#deleteclose-channel */
|
|
285
|
+
async delete(reason) {
|
|
286
|
+
return new Channel(await this.client.rest.delete(rest_1.Endpoints.channel(this.id), {
|
|
287
|
+
reason,
|
|
288
|
+
}), this.client).toJSON();
|
|
251
289
|
}
|
|
252
290
|
/** https://discord.com/developers/docs/resources/channel#delete-all-reactions */
|
|
253
291
|
deleteAllReactions(messageId, emoji) {
|
|
254
292
|
this.client.rest.delete(rest_1.Endpoints.channelMessageAllReactions(this.id, messageId, emoji));
|
|
255
293
|
}
|
|
294
|
+
/** https://discord.com/developers/docs/resources/channel#delete-message */
|
|
295
|
+
deleteMessage(messageId, reason) {
|
|
296
|
+
this.client.rest.delete(rest_1.Endpoints.channelMessage(this.id, messageId), {
|
|
297
|
+
reason,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
/** https://discord.com/developers/docs/resources/channel#delete-channel-permission */
|
|
301
|
+
deletePermission(overwriteId, reason) {
|
|
302
|
+
this.client.rest.delete(rest_1.Endpoints.channelPermission(this.id, overwriteId), {
|
|
303
|
+
reason,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/** https://discord.com/developers/docs/resources/channel#delete-user-reaction */
|
|
307
|
+
deleteReaction(messageId, emoji, userId) {
|
|
308
|
+
this.client.rest.delete(rest_1.Endpoints.channelMessageReaction(this.id, messageId, emoji, userId));
|
|
309
|
+
}
|
|
310
|
+
/** https://discord.com/developers/docs/resources/channel#modify-channel */
|
|
311
|
+
async edit(options, reason) {
|
|
312
|
+
return new Channel(await this.client.rest.patch(rest_1.Endpoints.channel(this.id), {
|
|
313
|
+
json: {
|
|
314
|
+
name: options.name,
|
|
315
|
+
type: options.type,
|
|
316
|
+
position: options.position,
|
|
317
|
+
topic: options.topic,
|
|
318
|
+
nsfw: options.nsfw,
|
|
319
|
+
rate_limit_per_user: options.rateLimitPerUser,
|
|
320
|
+
bitrate: options.bitrate,
|
|
321
|
+
permission_overwrites: options.permissionOverwrites,
|
|
322
|
+
parent_id: options.parentId,
|
|
323
|
+
rtc_region: options.rtcRegion,
|
|
324
|
+
video_quality_mode: options.videoQualityMode,
|
|
325
|
+
default_auto_archive_duration: options.defaultAutoArchiveDuration,
|
|
326
|
+
flags: options.flags,
|
|
327
|
+
available_tags: options.availableTags,
|
|
328
|
+
default_reaction_emoji: options.defaultReactionEmoji,
|
|
329
|
+
default_thread_rate_limit_per_user: options.defaultThreadRateLimitPerUser,
|
|
330
|
+
default_sort_order: options.defaultSortOrder,
|
|
331
|
+
default_forum_layout: options.defaultForumLayout,
|
|
332
|
+
archived: options.archived,
|
|
333
|
+
auto_archive_duration: options.autoArchiveDuration,
|
|
334
|
+
locked: options.locked,
|
|
335
|
+
invitable: options.invitable,
|
|
336
|
+
applied_tags: options.appliedTags,
|
|
337
|
+
},
|
|
338
|
+
reason,
|
|
339
|
+
}), this.client);
|
|
340
|
+
}
|
|
256
341
|
/** https://discord.com/developers/docs/resources/channel#edit-message */
|
|
257
342
|
async editMessage(messageId, options) {
|
|
258
343
|
return new _1.Message(await this.client.rest.patch(rest_1.Endpoints.channelMessage(this.id, messageId), {
|
|
@@ -275,21 +360,6 @@ class Channel extends _1.Base {
|
|
|
275
360
|
files: options.files,
|
|
276
361
|
}), this.client);
|
|
277
362
|
}
|
|
278
|
-
/** https://discord.com/developers/docs/resources/channel#delete-message */
|
|
279
|
-
deleteMessage(messageId, reason) {
|
|
280
|
-
this.client.rest.delete(rest_1.Endpoints.channelMessage(this.id, messageId), {
|
|
281
|
-
reason,
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
/** https://discord.com/developers/docs/resources/channel#bulk-delete-messages */
|
|
285
|
-
bulkDeleteMessages(options, reason) {
|
|
286
|
-
this.client.rest.post(rest_1.Endpoints.channelBulkDelete(this.id), {
|
|
287
|
-
json: {
|
|
288
|
-
messages: options?.messagesIds,
|
|
289
|
-
},
|
|
290
|
-
reason,
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
363
|
/** https://discord.com/developers/docs/resources/channel#edit-channel-permissions */
|
|
294
364
|
editPermissions(overwriteId, options, reason) {
|
|
295
365
|
this.client.rest.put(rest_1.Endpoints.channelPermission(this.id, overwriteId), {
|
|
@@ -297,33 +367,6 @@ class Channel extends _1.Base {
|
|
|
297
367
|
reason,
|
|
298
368
|
});
|
|
299
369
|
}
|
|
300
|
-
/** https://discord.com/developers/docs/resources/channel#get-channel-invites */
|
|
301
|
-
async getInvites() {
|
|
302
|
-
return this.client.rest
|
|
303
|
-
.get(rest_1.Endpoints.channelInvites(this.id))
|
|
304
|
-
.then((response) => response.map((data) => new _1.Invite(data, this.client)));
|
|
305
|
-
}
|
|
306
|
-
/** https://discord.com/developers/docs/resources/channel#create-channel-invite */
|
|
307
|
-
async createInvite(options, reason) {
|
|
308
|
-
return new _1.Invite(await this.client.rest.post(rest_1.Endpoints.channelInvites(this.id), {
|
|
309
|
-
json: {
|
|
310
|
-
max_age: options.maxAge,
|
|
311
|
-
max_uses: options.maxUses,
|
|
312
|
-
temporary: options.temporary,
|
|
313
|
-
unique: options.unique,
|
|
314
|
-
target_type: options.targetType,
|
|
315
|
-
target_user_id: options.targetUserId,
|
|
316
|
-
target_application_id: options.targetApplicationId,
|
|
317
|
-
},
|
|
318
|
-
reason,
|
|
319
|
-
}), this.client);
|
|
320
|
-
}
|
|
321
|
-
/** https://discord.com/developers/docs/resources/channel#delete-channel-permission */
|
|
322
|
-
deletePermission(overwriteId, reason) {
|
|
323
|
-
this.client.rest.delete(rest_1.Endpoints.channelPermission(this.id, overwriteId), {
|
|
324
|
-
reason,
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
370
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
|
328
371
|
async follow(options) {
|
|
329
372
|
return this.client.rest
|
|
@@ -337,110 +380,91 @@ class Channel extends _1.Base {
|
|
|
337
380
|
webhookId: response.webhook_id,
|
|
338
381
|
}));
|
|
339
382
|
}
|
|
340
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
341
|
-
|
|
342
|
-
this.client.rest.post(rest_1.Endpoints.channelTyping(this.id));
|
|
343
|
-
}
|
|
344
|
-
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
|
345
|
-
async getPinnedMessages() {
|
|
383
|
+
/** https://discord.com/developers/docs/resources/channel#list-public-archived-threads */
|
|
384
|
+
async getArchivedThreads(archivedStatus, options) {
|
|
346
385
|
return this.client.rest
|
|
347
|
-
.get(rest_1.Endpoints.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
pinMessage(messageId, reason) {
|
|
352
|
-
this.client.rest.put(rest_1.Endpoints.channelPin(this.id, messageId), {
|
|
353
|
-
reason,
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
/** https://discord.com/developers/docs/resources/channel#unpin-message */
|
|
357
|
-
unpinMessage(messageId, reason) {
|
|
358
|
-
this.client.rest.delete(rest_1.Endpoints.channelPin(this.id, messageId), {
|
|
359
|
-
reason,
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
/** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient */
|
|
363
|
-
addRecipient(userId, options) {
|
|
364
|
-
this.client.rest.put(rest_1.Endpoints.channelRecipient(this.id, userId), {
|
|
365
|
-
json: {
|
|
366
|
-
access_token: options.accessToken,
|
|
367
|
-
nick: options.nick,
|
|
386
|
+
.get(rest_1.Endpoints.channelThreads(this.id, archivedStatus, false), {
|
|
387
|
+
query: {
|
|
388
|
+
before: options?.before,
|
|
389
|
+
limit: options?.limit,
|
|
368
390
|
},
|
|
369
|
-
})
|
|
391
|
+
})
|
|
392
|
+
.then((response) => ({
|
|
393
|
+
threads: response.threads.map((data) => new Channel(data, this.client)),
|
|
394
|
+
members: response.members.map((data) => ({
|
|
395
|
+
id: data.id,
|
|
396
|
+
userId: data.user_id,
|
|
397
|
+
joinTimestamp: data.join_timestamp,
|
|
398
|
+
flags: data.flags,
|
|
399
|
+
member: data.member !== undefined
|
|
400
|
+
? new _1.GuildMember(data.member, this.client)
|
|
401
|
+
: undefined,
|
|
402
|
+
})),
|
|
403
|
+
hasMore: response.has_more,
|
|
404
|
+
}));
|
|
370
405
|
}
|
|
371
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
372
|
-
|
|
373
|
-
this.client.rest
|
|
406
|
+
/** https://discord.com/developers/docs/resources/channel#get-channel-invites */
|
|
407
|
+
async getInvites() {
|
|
408
|
+
return this.client.rest
|
|
409
|
+
.get(rest_1.Endpoints.channelInvites(this.id))
|
|
410
|
+
.then((response) => response.map((data) => new _1.Invite(data, this.client)));
|
|
374
411
|
}
|
|
375
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
376
|
-
async
|
|
377
|
-
return
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
412
|
+
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
|
|
413
|
+
async getJoinedPrivateArchivedThreads(options) {
|
|
414
|
+
return this.client.rest
|
|
415
|
+
.get(rest_1.Endpoints.channelThreads(this.id, "private", true), {
|
|
416
|
+
query: {
|
|
417
|
+
before: options?.before,
|
|
418
|
+
limit: options?.limit,
|
|
382
419
|
},
|
|
383
|
-
|
|
384
|
-
|
|
420
|
+
})
|
|
421
|
+
.then((response) => ({
|
|
422
|
+
threads: response.threads.map((data) => new Channel(data, this.client)),
|
|
423
|
+
members: response.members.map((data) => ({
|
|
424
|
+
id: data.id,
|
|
425
|
+
userId: data.user_id,
|
|
426
|
+
joinTimestamp: data.join_timestamp,
|
|
427
|
+
flags: data.flags,
|
|
428
|
+
member: data.member !== undefined
|
|
429
|
+
? new _1.GuildMember(data.member, this.client)
|
|
430
|
+
: undefined,
|
|
431
|
+
})),
|
|
432
|
+
hasMore: response.has_more,
|
|
433
|
+
}));
|
|
385
434
|
}
|
|
386
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
387
|
-
async
|
|
388
|
-
return new
|
|
389
|
-
json: {
|
|
390
|
-
name: options.name,
|
|
391
|
-
auto_archive_duration: options.autoArchiveDuration,
|
|
392
|
-
type: options.type,
|
|
393
|
-
invitable: options.invitable,
|
|
394
|
-
rate_limit_per_user: options.rateLimitPerUser,
|
|
395
|
-
},
|
|
396
|
-
reason,
|
|
397
|
-
}), this.client);
|
|
435
|
+
/** https://discord.com/developers/docs/resources/channel#get-channel-message */
|
|
436
|
+
async getMessage(messageId) {
|
|
437
|
+
return new _1.Message(await this.client.rest.get(rest_1.Endpoints.channelMessage(this.id, messageId)), this.client);
|
|
398
438
|
}
|
|
399
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
400
|
-
async
|
|
401
|
-
return
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
embeds: options.message.embeds,
|
|
409
|
-
flags: options.message.flags,
|
|
410
|
-
allowed_mentions: {
|
|
411
|
-
parse: options.message.allowedMentions?.parse,
|
|
412
|
-
roles: options.message.allowedMentions?.roles,
|
|
413
|
-
users: options.message.allowedMentions?.users,
|
|
414
|
-
replied_user: options.message.allowedMentions?.repliedUser,
|
|
415
|
-
},
|
|
416
|
-
components: options.message.components !== undefined
|
|
417
|
-
? options.message.components !== null
|
|
418
|
-
? this.client.util.messageComponentToRaw(options.message.components)
|
|
419
|
-
: null
|
|
420
|
-
: undefined,
|
|
421
|
-
attachments: options.message.attachments,
|
|
422
|
-
},
|
|
423
|
-
applied_tags: options.appliedTags,
|
|
439
|
+
/** https://discord.com/developers/docs/resources/channel#get-channel-messages */
|
|
440
|
+
async getMessages(options) {
|
|
441
|
+
return this.client.rest
|
|
442
|
+
.get(rest_1.Endpoints.channelMessages(this.id), {
|
|
443
|
+
query: {
|
|
444
|
+
around: options.around,
|
|
445
|
+
before: options.before,
|
|
446
|
+
after: options.after,
|
|
447
|
+
limit: options.limit,
|
|
424
448
|
},
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}), this.client);
|
|
428
|
-
}
|
|
429
|
-
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
|
430
|
-
joinThread() {
|
|
431
|
-
this.client.rest.put(rest_1.Endpoints.threadMembers(this.id, "@me"));
|
|
432
|
-
}
|
|
433
|
-
/** https://discord.com/developers/docs/resources/channel#add-thread-member */
|
|
434
|
-
addThreadMember(userId) {
|
|
435
|
-
this.client.rest.put(rest_1.Endpoints.threadMembers(this.id, userId));
|
|
449
|
+
})
|
|
450
|
+
.then((response) => response.map((data) => new _1.Message(data, this.client)));
|
|
436
451
|
}
|
|
437
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
438
|
-
|
|
439
|
-
this.client.rest
|
|
452
|
+
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
|
453
|
+
async getPinnedMessages() {
|
|
454
|
+
return this.client.rest
|
|
455
|
+
.get(rest_1.Endpoints.channelPins(this.id))
|
|
456
|
+
.then((response) => response.map((data) => new _1.Message(data, this.client)));
|
|
440
457
|
}
|
|
441
|
-
/** https://discord.com/developers/docs/resources/channel#
|
|
442
|
-
|
|
443
|
-
this.client.rest
|
|
458
|
+
/** https://discord.com/developers/docs/resources/channel#get-reactions */
|
|
459
|
+
async getReactions(messageId, emoji, options) {
|
|
460
|
+
return this.client.rest
|
|
461
|
+
.get(rest_1.Endpoints.channelMessageAllReactions(this.id, messageId, emoji), {
|
|
462
|
+
query: {
|
|
463
|
+
after: options?.after,
|
|
464
|
+
limit: options?.limit,
|
|
465
|
+
},
|
|
466
|
+
})
|
|
467
|
+
.then((response) => response.map((data) => new _1.User(data, this.client)));
|
|
444
468
|
}
|
|
445
469
|
/** https://discord.com/developers/docs/resources/channel#get-thread-member */
|
|
446
470
|
async getThreadMember(userId, options) {
|
|
@@ -480,68 +504,44 @@ class Channel extends _1.Base {
|
|
|
480
504
|
: undefined,
|
|
481
505
|
})));
|
|
482
506
|
}
|
|
483
|
-
/** https://discord.com/developers/docs/resources/channel#list-public-archived-threads */
|
|
484
|
-
async getArchivedThreads(archivedStatus, options) {
|
|
485
|
-
return this.client.rest
|
|
486
|
-
.get(rest_1.Endpoints.channelThreads(this.id, archivedStatus, false), {
|
|
487
|
-
query: {
|
|
488
|
-
before: options?.before,
|
|
489
|
-
limit: options?.limit,
|
|
490
|
-
},
|
|
491
|
-
})
|
|
492
|
-
.then((response) => ({
|
|
493
|
-
threads: response.threads.map((data) => new Channel(data, this.client)),
|
|
494
|
-
members: response.members.map((data) => ({
|
|
495
|
-
id: data.id,
|
|
496
|
-
userId: data.user_id,
|
|
497
|
-
joinTimestamp: data.join_timestamp,
|
|
498
|
-
flags: data.flags,
|
|
499
|
-
member: data.member !== undefined
|
|
500
|
-
? new _1.GuildMember(data.member, this.client)
|
|
501
|
-
: undefined,
|
|
502
|
-
})),
|
|
503
|
-
hasMore: response.has_more,
|
|
504
|
-
}));
|
|
505
|
-
}
|
|
506
|
-
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
|
|
507
|
-
async getJoinedPrivateArchivedThreads(options) {
|
|
508
|
-
return this.client.rest
|
|
509
|
-
.get(rest_1.Endpoints.channelThreads(this.id, "private", true), {
|
|
510
|
-
query: {
|
|
511
|
-
before: options?.before,
|
|
512
|
-
limit: options?.limit,
|
|
513
|
-
},
|
|
514
|
-
})
|
|
515
|
-
.then((response) => ({
|
|
516
|
-
threads: response.threads.map((data) => new Channel(data, this.client)),
|
|
517
|
-
members: response.members.map((data) => ({
|
|
518
|
-
id: data.id,
|
|
519
|
-
userId: data.user_id,
|
|
520
|
-
joinTimestamp: data.join_timestamp,
|
|
521
|
-
flags: data.flags,
|
|
522
|
-
member: data.member !== undefined
|
|
523
|
-
? new _1.GuildMember(data.member, this.client)
|
|
524
|
-
: undefined,
|
|
525
|
-
})),
|
|
526
|
-
hasMore: response.has_more,
|
|
527
|
-
}));
|
|
528
|
-
}
|
|
529
|
-
/** https://discord.com/developers/docs/resources/webhook#create-webhook */
|
|
530
|
-
async createWebhook(options, reason) {
|
|
531
|
-
return new _1.Webhook(await this.client.rest.post(rest_1.Endpoints.channelWebhooks(this.id), {
|
|
532
|
-
json: {
|
|
533
|
-
name: options.name,
|
|
534
|
-
avatar: options.avatar,
|
|
535
|
-
},
|
|
536
|
-
reason,
|
|
537
|
-
}), this.client);
|
|
538
|
-
}
|
|
539
507
|
/** https://discord.com/developers/docs/resources/webhook#get-channel-webhooks */
|
|
540
508
|
async getWebhooks() {
|
|
541
509
|
return this.client.rest
|
|
542
510
|
.get(rest_1.Endpoints.channelWebhooks(this.id))
|
|
543
511
|
.then((response) => response.map((data) => new _1.Webhook(data, this.client)));
|
|
544
512
|
}
|
|
513
|
+
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
|
514
|
+
joinThread() {
|
|
515
|
+
this.client.rest.put(rest_1.Endpoints.threadMembers(this.id, "@me"));
|
|
516
|
+
}
|
|
517
|
+
/** https://discord.com/developers/docs/resources/channel#leave-thread */
|
|
518
|
+
leaveThread() {
|
|
519
|
+
this.client.rest.delete(rest_1.Endpoints.threadMembers(this.id, "@me"));
|
|
520
|
+
}
|
|
521
|
+
/** https://discord.com/developers/docs/resources/channel#pin-message */
|
|
522
|
+
pinMessage(messageId, reason) {
|
|
523
|
+
this.client.rest.put(rest_1.Endpoints.channelPin(this.id, messageId), {
|
|
524
|
+
reason,
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
/** https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient */
|
|
528
|
+
removeRecipient(userId) {
|
|
529
|
+
this.client.rest.delete(rest_1.Endpoints.channelRecipient(this.id, userId));
|
|
530
|
+
}
|
|
531
|
+
/** https://discord.com/developers/docs/resources/channel#remove-thread-member */
|
|
532
|
+
removeThreadMember(userId) {
|
|
533
|
+
this.client.rest.delete(rest_1.Endpoints.threadMembers(this.id, userId));
|
|
534
|
+
}
|
|
535
|
+
/** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
|
|
536
|
+
triggerTypingIndicator() {
|
|
537
|
+
this.client.rest.post(rest_1.Endpoints.channelTyping(this.id));
|
|
538
|
+
}
|
|
539
|
+
/** https://discord.com/developers/docs/resources/channel#unpin-message */
|
|
540
|
+
unpinMessage(messageId, reason) {
|
|
541
|
+
this.client.rest.delete(rest_1.Endpoints.channelPin(this.id, messageId), {
|
|
542
|
+
reason,
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
545
|
toRaw() {
|
|
546
546
|
return this.raw;
|
|
547
547
|
}
|