disgroove 3.0.1-dev.b082a0c → 3.0.1-dev.b57a9f0
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/LICENSE +1 -1
- package/dist/lib/Client.d.ts +78 -3
- package/dist/lib/Client.js +104 -1
- package/dist/lib/constants.d.ts +68 -6
- package/dist/lib/constants.js +75 -5
- package/dist/lib/gateway/Dispatcher.d.ts +4 -1
- package/dist/lib/gateway/Dispatcher.js +19 -0
- package/dist/lib/gateway/Transmitter.d.ts +3 -1
- package/dist/lib/gateway/Transmitter.js +7 -0
- package/dist/lib/rest/Endpoints.d.ts +7 -1
- package/dist/lib/rest/Endpoints.js +15 -3
- package/dist/lib/rest/RequestManager.d.ts +1 -0
- package/dist/lib/rest/RequestManager.js +2 -3
- package/dist/lib/transformers/Applications.js +2 -0
- package/dist/lib/transformers/AuditLogs.js +2 -0
- package/dist/lib/transformers/Components.d.ts +1 -1
- package/dist/lib/transformers/Components.js +8 -0
- package/dist/lib/transformers/Lobbies.d.ts +3 -1
- package/dist/lib/transformers/Lobbies.js +29 -0
- package/dist/lib/transformers/Messages.d.ts +1 -1
- package/dist/lib/transformers/Messages.js +62 -20
- package/dist/lib/types/application.d.ts +4 -2
- package/dist/lib/types/audit-log.d.ts +2 -0
- package/dist/lib/types/components.d.ts +9 -3
- package/dist/lib/types/gateway-events.d.ts +59 -1
- package/dist/lib/types/lobby.d.ts +36 -1
- package/dist/lib/types/message.d.ts +29 -1
- package/dist/package.json +4 -3
- package/package.json +5 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright ©
|
|
3
|
+
Copyright © 2026 Sergio Gotuzzo
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/dist/lib/Client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type ReactionTypes, type ApplicationCommandTypes, type EventTypes, type TriggerTypes, type ChannelTypes, type VideoQualityModes, type SortOrderTypes, type ForumLayoutTypes, type InviteTargetTypes, type VerificationLevel, type DefaultMessageNotificationLevel, type ExplicitContentFilterLevel, type SystemChannelFlags, type ApplicationFlags, type ApplicationIntegrationTypes, type ChannelFlags, type GuildFeatures, type GuildScheduledEventEntityTypes, type GuildScheduledEventPrivacyLevel, type GuildScheduledEventStatus, type MessageFlags, type OnboardingMode, type PrivacyLevel, type GuildMemberFlags, type InteractionContextTypes, type LobbyMemberFlags, InviteTargetUsersJobStatusErrorCodes } from "./constants";
|
|
1
|
+
import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type ReactionTypes, type ApplicationCommandTypes, type EventTypes, type TriggerTypes, type ChannelTypes, type VideoQualityModes, type SortOrderTypes, type ForumLayoutTypes, type InviteTargetTypes, type VerificationLevel, type DefaultMessageNotificationLevel, type ExplicitContentFilterLevel, type SystemChannelFlags, type ApplicationFlags, type ApplicationIntegrationTypes, type ChannelFlags, type GuildFeatures, type GuildScheduledEventEntityTypes, type GuildScheduledEventPrivacyLevel, type GuildScheduledEventStatus, type MessageFlags, type OnboardingMode, type PrivacyLevel, type GuildMemberFlags, type InteractionContextTypes, type LobbyMemberFlags, type InviteTargetUsersJobStatusErrorCodes, type AuthorTypes, type SearchHasTypes, type SearchEmbedTypes, type SearchSortModes, EntryPointCommandHandlerTypes } from "./constants";
|
|
2
2
|
import { RequestManager, type FileData } from "./rest";
|
|
3
3
|
import EventEmitter from "node:events";
|
|
4
4
|
import { Shard } from "./gateway";
|
|
@@ -11,7 +11,7 @@ import type { Channel, FollowedChannel, ThreadMember, Overwrite, DefaultReaction
|
|
|
11
11
|
import type { LocaleMap, snowflake, timestamp } from "./types/common";
|
|
12
12
|
import type { Emoji } from "./types/emoji";
|
|
13
13
|
import type { Entitlement } from "./types/entitlements";
|
|
14
|
-
import type { AutoModerationActionExecutionEvent, ChannelPinsUpdateEvent, ThreadListSyncEvent, ThreadMemberUpdateEventExtra, ThreadMembersUpdateEvent, GuildCreateEventExtra, GuildAuditLogEntryCreateExtra, GuildBanAddEvent, GuildBanRemoveEvent, GuildMemberAddEventExtra, GuildMemberRemoveEvent, GuildMemberUpdateEvent, GuildMembersChunkEvent, IntegrationCreateEventExtra, IntegrationUpdateEventExtra, IntegrationDeleteEvent, InviteCreateEvent, InviteDeleteEvent, MessageCreateEventExtra, MessageDeleteEvent, MessageDeleteBulkEvent, MessageReactionAddEvent, MessageReactionRemoveEvent, MessageReactionRemoveAllEvent, MessageReactionRemoveEmojiEvent, PresenceUpdateEvent, TypingStartEvent, VoiceServerUpdateEvent, MessagePollVoteAddEvent, MessagePollVoteRemoveEvent, GatewayPresenceUpdate, RawPayload, IdentifyConnectionProperties, VoiceChannelEffectSendEvent, GuildSoundboardSoundDeleteEvent, RateLimitedEvent } from "./types/gateway-events";
|
|
14
|
+
import type { AutoModerationActionExecutionEvent, ChannelPinsUpdateEvent, ThreadListSyncEvent, ThreadMemberUpdateEventExtra, ThreadMembersUpdateEvent, GuildCreateEventExtra, GuildAuditLogEntryCreateExtra, GuildBanAddEvent, GuildBanRemoveEvent, GuildMemberAddEventExtra, GuildMemberRemoveEvent, GuildMemberUpdateEvent, GuildMembersChunkEvent, IntegrationCreateEventExtra, IntegrationUpdateEventExtra, IntegrationDeleteEvent, InviteCreateEvent, InviteDeleteEvent, MessageCreateEventExtra, MessageDeleteEvent, MessageDeleteBulkEvent, MessageReactionAddEvent, MessageReactionRemoveEvent, MessageReactionRemoveAllEvent, MessageReactionRemoveEmojiEvent, PresenceUpdateEvent, TypingStartEvent, VoiceServerUpdateEvent, MessagePollVoteAddEvent, MessagePollVoteRemoveEvent, GatewayPresenceUpdate, RawPayload, IdentifyConnectionProperties, VoiceChannelEffectSendEvent, GuildSoundboardSoundDeleteEvent, RateLimitedEvent, ChannelInfoEvent, VoiceChannelStatusUpdateEvent, VoiceChannelStartTimeUpdateEvent } from "./types/gateway-events";
|
|
15
15
|
import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel, IncidentsData } from "./types/guild";
|
|
16
16
|
import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata, GuildScheduledEventRecurrenceRule } from "./types/guild-scheduled-event";
|
|
17
17
|
import type { GuildTemplate } from "./types/guild-template";
|
|
@@ -30,7 +30,7 @@ import type { Embed, AllowedMentions, Attachment, Message, MessageReference, Mes
|
|
|
30
30
|
import type { Subscription } from "./types/subscription";
|
|
31
31
|
import type { SoundboardSound } from "./types/soundboard";
|
|
32
32
|
import type { ActionRow, Button, ChannelSelect, Container, File, MediaGallery, MentionableSelect, RoleSelect, Section, Separator, StringSelect, TextDisplay, Thumbnail, UserSelect } from "./types/components";
|
|
33
|
-
import type
|
|
33
|
+
import { LobbyInvite, type Lobby, type LobbyMember, type LobbyMessage } from "./types/lobby";
|
|
34
34
|
export interface GatewayOptions {
|
|
35
35
|
properties?: IdentifyConnectionProperties;
|
|
36
36
|
compress?: boolean;
|
|
@@ -131,6 +131,13 @@ export declare class Client extends EventEmitter {
|
|
|
131
131
|
type?: ApplicationCommandTypes;
|
|
132
132
|
nsfw?: boolean;
|
|
133
133
|
}>): Promise<Array<ApplicationCommand>>;
|
|
134
|
+
/** https://docs.discord.com/developers/resources/lobby#bulk-update-lobby-members */
|
|
135
|
+
bulkUpdateLobbyMembers(lobbyId: snowflake, options: {
|
|
136
|
+
id: snowflake;
|
|
137
|
+
metadata?: Record<string, string> | null;
|
|
138
|
+
flags?: LobbyMemberFlags;
|
|
139
|
+
removeMember?: boolean;
|
|
140
|
+
}): Promise<Array<LobbyMember>>;
|
|
134
141
|
/** https://discord.com/developers/docs/topics/gateway#connections */
|
|
135
142
|
connect(): Promise<void>;
|
|
136
143
|
/** https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement */
|
|
@@ -205,6 +212,7 @@ export declare class Client extends EventEmitter {
|
|
|
205
212
|
contexts?: Array<InteractionContextTypes>;
|
|
206
213
|
type?: ApplicationCommandTypes;
|
|
207
214
|
nsfw?: boolean;
|
|
215
|
+
handler?: EntryPointCommandHandlerTypes;
|
|
208
216
|
}): Promise<ApplicationCommand>;
|
|
209
217
|
/** https://discord.com/developers/docs/resources/user#create-group-dm */
|
|
210
218
|
createGroup(options: {
|
|
@@ -301,6 +309,10 @@ export declare class Client extends EventEmitter {
|
|
|
301
309
|
members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags">>;
|
|
302
310
|
idleTimeoutSeconds?: number;
|
|
303
311
|
}): Promise<Lobby>;
|
|
312
|
+
/** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-self */
|
|
313
|
+
createLobbyChannelSelfInvite(lobbyId: snowflake): Promise<LobbyInvite>;
|
|
314
|
+
/** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-user */
|
|
315
|
+
createLobbyChannelUserInvite(lobbyId: snowflake, userId: snowflake): Promise<LobbyInvite>;
|
|
304
316
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
|
305
317
|
createMessage(channelId: snowflake, options: {
|
|
306
318
|
content?: string;
|
|
@@ -377,6 +389,8 @@ export declare class Client extends EventEmitter {
|
|
|
377
389
|
deleteChannel(channelId: snowflake, reason?: string): Promise<Channel>;
|
|
378
390
|
/** https://discord.com/developers/docs/resources/channel#delete-channel-permission */
|
|
379
391
|
deleteChannelPermission(channelId: snowflake, overwriteId: snowflake, reason?: string): void;
|
|
392
|
+
/** https://docs.discord.com/developers/resources/user#delete-current-user-application-role-connection */
|
|
393
|
+
deleteCurrentUserApplicationRoleConnection(applicationId: snowflake): void;
|
|
380
394
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
|
|
381
395
|
deleteGlobalApplicationCommand(applicationId: snowflake, commandId: snowflake): void;
|
|
382
396
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
|
@@ -524,6 +538,7 @@ export declare class Client extends EventEmitter {
|
|
|
524
538
|
integrationTypes?: Array<ApplicationIntegrationTypes>;
|
|
525
539
|
contexts?: Array<InteractionContextTypes>;
|
|
526
540
|
nsfw?: boolean;
|
|
541
|
+
handler?: EntryPointCommandHandlerTypes;
|
|
527
542
|
}): Promise<ApplicationCommand>;
|
|
528
543
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
|
529
544
|
editGuild(guildId: snowflake, options: {
|
|
@@ -974,6 +989,10 @@ export declare class Client extends EventEmitter {
|
|
|
974
989
|
}>;
|
|
975
990
|
/** https://discord.com/developers/docs/resources/lobby#get-lobby */
|
|
976
991
|
getLobby(lobbyId: snowflake): Promise<Lobby>;
|
|
992
|
+
/** https://docs.discord.com/developers/resources/lobby#get-lobby-messages */
|
|
993
|
+
getLobbyMessages(lobbyId: snowflake, options?: {
|
|
994
|
+
limit?: number;
|
|
995
|
+
}): Promise<Array<LobbyMessage>>;
|
|
977
996
|
/** https://discord.com/developers/docs/resources/message#get-channel-message */
|
|
978
997
|
getMessage(channelId: snowflake, messageId: snowflake): Promise<Message>;
|
|
979
998
|
/** https://discord.com/developers/docs/resources/message#get-reactions */
|
|
@@ -1054,6 +1073,13 @@ export declare class Client extends EventEmitter {
|
|
|
1054
1073
|
}): Promise<Message>;
|
|
1055
1074
|
/** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
|
|
1056
1075
|
getWebhooks(guildId: snowflake): Promise<Array<Webhook>>;
|
|
1076
|
+
/** https://docs.discord.com/developers/resources/lobby#create-or-join-lobby */
|
|
1077
|
+
joinLobby(options: {
|
|
1078
|
+
secret: string;
|
|
1079
|
+
idleTimeoutSeconds?: number;
|
|
1080
|
+
lobbyMetadata?: Record<string, string> | null;
|
|
1081
|
+
memberMetadata?: Record<string, string> | null;
|
|
1082
|
+
}): Promise<Lobby>;
|
|
1057
1083
|
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
|
1058
1084
|
joinThread(channelId: snowflake): void;
|
|
1059
1085
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
|
@@ -1092,6 +1118,46 @@ export declare class Client extends EventEmitter {
|
|
|
1092
1118
|
query: string;
|
|
1093
1119
|
limit?: number;
|
|
1094
1120
|
}): Promise<Array<GuildMember>>;
|
|
1121
|
+
/** https://docs.discord.com/developers/resources/message#search-guild-messages */
|
|
1122
|
+
searchGuildMessages(guildId: snowflake, options?: {
|
|
1123
|
+
limit?: number;
|
|
1124
|
+
offset?: number;
|
|
1125
|
+
maxId?: snowflake;
|
|
1126
|
+
minId?: snowflake;
|
|
1127
|
+
slop?: number;
|
|
1128
|
+
content?: string;
|
|
1129
|
+
channelId?: snowflake;
|
|
1130
|
+
authorType?: Array<AuthorTypes>;
|
|
1131
|
+
authorId?: Array<snowflake>;
|
|
1132
|
+
mentions?: Array<snowflake>;
|
|
1133
|
+
mentionsRolesId?: Array<snowflake>;
|
|
1134
|
+
mentionEveryone?: boolean;
|
|
1135
|
+
repliedToUserId?: Array<snowflake>;
|
|
1136
|
+
repliedToMessageId?: Array<snowflake>;
|
|
1137
|
+
pinned?: boolean;
|
|
1138
|
+
has?: Array<SearchHasTypes>;
|
|
1139
|
+
embedType?: Array<SearchEmbedTypes>;
|
|
1140
|
+
embedProvider?: Array<string>;
|
|
1141
|
+
linkHostname?: Array<string>;
|
|
1142
|
+
attachmentFilename?: Array<string>;
|
|
1143
|
+
attachmentExtension?: Array<string>;
|
|
1144
|
+
sortBy?: SearchSortModes;
|
|
1145
|
+
sortOrder?: string;
|
|
1146
|
+
includeNfsw?: boolean;
|
|
1147
|
+
}): Promise<{
|
|
1148
|
+
doingDeepHistoricalIndex: boolean;
|
|
1149
|
+
documentsIndexed?: number;
|
|
1150
|
+
totalResults: number;
|
|
1151
|
+
messages: Array<Message>;
|
|
1152
|
+
threads?: Array<Channel>;
|
|
1153
|
+
members?: Array<ThreadMember>;
|
|
1154
|
+
}>;
|
|
1155
|
+
/** https://docs.discord.com/developers/resources/lobby#send-lobby-message */
|
|
1156
|
+
sendLobbyMessage(lobbyId: snowflake, options: {
|
|
1157
|
+
content: string;
|
|
1158
|
+
metadata?: Record<string, string> | null;
|
|
1159
|
+
flags?: MessageFlags;
|
|
1160
|
+
}): Promise<LobbyMessage>;
|
|
1095
1161
|
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
|
1096
1162
|
sendSoundboardSound(channelId: snowflake, options: {
|
|
1097
1163
|
soundId: snowflake;
|
|
@@ -1099,6 +1165,10 @@ export declare class Client extends EventEmitter {
|
|
|
1099
1165
|
}): void;
|
|
1100
1166
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
|
1101
1167
|
setPresence(options: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>): void;
|
|
1168
|
+
/** https://docs.discord.com/developers/resources/channel#set-voice-channel-status */
|
|
1169
|
+
setVoiceChannelStatus(channelId: snowflake, options: {
|
|
1170
|
+
status: string | null;
|
|
1171
|
+
}, reason?: string): void;
|
|
1102
1172
|
/** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
|
|
1103
1173
|
syncGuildTemplate(guildId: snowflake, code: string): Promise<GuildTemplate>;
|
|
1104
1174
|
/** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
|
|
@@ -1115,6 +1185,8 @@ export declare class Client extends EventEmitter {
|
|
|
1115
1185
|
}): Promise<ApplicationRoleConnection>;
|
|
1116
1186
|
/** https://discord.com/developers/docs/resources/invite#update-target-users */
|
|
1117
1187
|
updateInviteTargetUser(inviteCode: string, targetUsersFile: FileData): void;
|
|
1188
|
+
/** https://docs.discord.com/developers/resources/lobby#update-lobby-message-moderation-metadata */
|
|
1189
|
+
updateLobbyMessageModerationMetadata(lobbyId: snowflake, messageId: snowflake, metadata: Record<string, string>): void;
|
|
1118
1190
|
/** https://discord.com/developers/docs/resources/channel#unpin-message */
|
|
1119
1191
|
unpinMessage(channelId: snowflake, messageId: snowflake, reason?: string): void;
|
|
1120
1192
|
}
|
|
@@ -1154,6 +1226,7 @@ export interface ClientEvents {
|
|
|
1154
1226
|
channelCreate: [channel: Channel];
|
|
1155
1227
|
channelUpdate: [channel: Channel];
|
|
1156
1228
|
channelDelete: [channel: Channel];
|
|
1229
|
+
channelInfo: [info: ChannelInfoEvent];
|
|
1157
1230
|
channelPinsUpdate: [pins: ChannelPinsUpdateEvent];
|
|
1158
1231
|
threadCreate: [thread: Channel];
|
|
1159
1232
|
threadUpdate: [thread: Channel];
|
|
@@ -1229,6 +1302,8 @@ export interface ClientEvents {
|
|
|
1229
1302
|
typingStart: [typing: TypingStartEvent];
|
|
1230
1303
|
userUpdate: [user: User];
|
|
1231
1304
|
voiceChannelEffectSend: [voiceEffect: VoiceChannelEffectSendEvent];
|
|
1305
|
+
voiceChannelStatusUpdate: [voiceChannel: VoiceChannelStatusUpdateEvent];
|
|
1306
|
+
voiceChannelStartTimeUpdate: [voiceChannel: VoiceChannelStartTimeUpdateEvent];
|
|
1232
1307
|
voiceStateUpdate: [voiceState: VoiceState];
|
|
1233
1308
|
voiceServerUpdate: [voiceServer: VoiceServerUpdateEvent];
|
|
1234
1309
|
webhooksUpdate: [channelId: snowflake, guildId: snowflake];
|
package/dist/lib/Client.js
CHANGED
|
@@ -159,6 +159,13 @@ class Client extends node_events_1.default {
|
|
|
159
159
|
});
|
|
160
160
|
return response.map((c) => transformers_1.ApplicationCommands.applicationCommandFromRaw(c));
|
|
161
161
|
}
|
|
162
|
+
/** https://docs.discord.com/developers/resources/lobby#bulk-update-lobby-members */
|
|
163
|
+
async bulkUpdateLobbyMembers(lobbyId, options) {
|
|
164
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbyMembersBulk(lobbyId), {
|
|
165
|
+
json: options,
|
|
166
|
+
});
|
|
167
|
+
return response.map((lobbyMember) => transformers_1.Lobbies.lobbyMemberFromRaw(lobbyMember));
|
|
168
|
+
}
|
|
162
169
|
/** https://discord.com/developers/docs/topics/gateway#connections */
|
|
163
170
|
async connect() {
|
|
164
171
|
this.shardsCount =
|
|
@@ -287,6 +294,7 @@ class Client extends node_events_1.default {
|
|
|
287
294
|
contexts: options.contexts,
|
|
288
295
|
type: options.type,
|
|
289
296
|
nsfw: options.nsfw,
|
|
297
|
+
handler: options.handler,
|
|
290
298
|
},
|
|
291
299
|
});
|
|
292
300
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
@@ -609,6 +617,16 @@ class Client extends node_events_1.default {
|
|
|
609
617
|
});
|
|
610
618
|
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
611
619
|
}
|
|
620
|
+
/** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-self */
|
|
621
|
+
async createLobbyChannelSelfInvite(lobbyId) {
|
|
622
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbyChannelInvite(lobbyId));
|
|
623
|
+
return response;
|
|
624
|
+
}
|
|
625
|
+
/** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-user */
|
|
626
|
+
async createLobbyChannelUserInvite(lobbyId, userId) {
|
|
627
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbyChannelInvite(lobbyId, userId));
|
|
628
|
+
return response;
|
|
629
|
+
}
|
|
612
630
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
|
613
631
|
async createMessage(channelId, options) {
|
|
614
632
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(channelId), {
|
|
@@ -781,6 +799,10 @@ class Client extends node_events_1.default {
|
|
|
781
799
|
reason,
|
|
782
800
|
});
|
|
783
801
|
}
|
|
802
|
+
/** https://docs.discord.com/developers/resources/user#delete-current-user-application-role-connection */
|
|
803
|
+
deleteCurrentUserApplicationRoleConnection(applicationId) {
|
|
804
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userApplicationRoleConnection(applicationId));
|
|
805
|
+
}
|
|
784
806
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
|
|
785
807
|
deleteGlobalApplicationCommand(applicationId, commandId) {
|
|
786
808
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationCommand(applicationId, commandId));
|
|
@@ -1059,6 +1081,7 @@ class Client extends node_events_1.default {
|
|
|
1059
1081
|
integration_types: options.integrationTypes,
|
|
1060
1082
|
contexts: options.contexts,
|
|
1061
1083
|
nsfw: options.nsfw,
|
|
1084
|
+
handler: options.handler,
|
|
1062
1085
|
},
|
|
1063
1086
|
});
|
|
1064
1087
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
@@ -2177,7 +2200,9 @@ class Client extends node_events_1.default {
|
|
|
2177
2200
|
}
|
|
2178
2201
|
/** https://discord.com/developers/docs/resources/invite#get-target-users */
|
|
2179
2202
|
getInviteTargetUser(inviteCode) {
|
|
2180
|
-
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.inviteTargetUsers(inviteCode)
|
|
2203
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.inviteTargetUsers(inviteCode), {
|
|
2204
|
+
returnsBlob: true,
|
|
2205
|
+
});
|
|
2181
2206
|
}
|
|
2182
2207
|
async getInviteTargetUserJobStatus(inviteCode) {
|
|
2183
2208
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.inviteTargetUsersJobStatus(inviteCode));
|
|
@@ -2209,6 +2234,13 @@ class Client extends node_events_1.default {
|
|
|
2209
2234
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobby(lobbyId));
|
|
2210
2235
|
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2211
2236
|
}
|
|
2237
|
+
/** https://docs.discord.com/developers/resources/lobby#get-lobby-messages */
|
|
2238
|
+
async getLobbyMessages(lobbyId, options) {
|
|
2239
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobbyMessages(lobbyId), {
|
|
2240
|
+
query: options,
|
|
2241
|
+
});
|
|
2242
|
+
return response.map((lobbyMessage) => transformers_1.Lobbies.lobbyMessageFromRaw(lobbyMessage));
|
|
2243
|
+
}
|
|
2212
2244
|
/** https://discord.com/developers/docs/resources/message#get-channel-message */
|
|
2213
2245
|
async getMessage(channelId, messageId) {
|
|
2214
2246
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelId, messageId));
|
|
@@ -2389,6 +2421,18 @@ class Client extends node_events_1.default {
|
|
|
2389
2421
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWebhooks(guildId));
|
|
2390
2422
|
return response.map((webhook) => transformers_1.Webhooks.webhookFromRaw(webhook));
|
|
2391
2423
|
}
|
|
2424
|
+
/** https://docs.discord.com/developers/resources/lobby#create-or-join-lobby */
|
|
2425
|
+
async joinLobby(options) {
|
|
2426
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.lobbies(), {
|
|
2427
|
+
json: {
|
|
2428
|
+
secret: options.secret,
|
|
2429
|
+
idle_timeout_seconds: options.idleTimeoutSeconds,
|
|
2430
|
+
lobby_metadata: options.lobbyMetadata,
|
|
2431
|
+
member_metadata: options.memberMetadata,
|
|
2432
|
+
},
|
|
2433
|
+
});
|
|
2434
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2435
|
+
}
|
|
2392
2436
|
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
|
2393
2437
|
joinThread(channelId) {
|
|
2394
2438
|
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelId));
|
|
@@ -2482,6 +2526,52 @@ class Client extends node_events_1.default {
|
|
|
2482
2526
|
});
|
|
2483
2527
|
return response.map((guildMember) => transformers_1.Guilds.guildMemberFromRaw(guildMember));
|
|
2484
2528
|
}
|
|
2529
|
+
/** https://docs.discord.com/developers/resources/message#search-guild-messages */
|
|
2530
|
+
async searchGuildMessages(guildId, options) {
|
|
2531
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMessagesSearch(guildId), {
|
|
2532
|
+
query: {
|
|
2533
|
+
limit: options?.limit,
|
|
2534
|
+
offset: options?.offset,
|
|
2535
|
+
max_id: options?.maxId,
|
|
2536
|
+
min_id: options?.minId,
|
|
2537
|
+
slop: options?.slop,
|
|
2538
|
+
content: options?.content,
|
|
2539
|
+
channel_id: options?.channelId,
|
|
2540
|
+
author_type: options?.authorType,
|
|
2541
|
+
author_id: options?.authorId,
|
|
2542
|
+
mentions: options?.mentions,
|
|
2543
|
+
mentions_roles_id: options?.mentionsRolesId,
|
|
2544
|
+
mention_everyone: options?.mentionEveryone,
|
|
2545
|
+
replied_to_user_id: options?.repliedToUserId,
|
|
2546
|
+
replied_to_message_id: options?.repliedToMessageId,
|
|
2547
|
+
pinned: options?.pinned,
|
|
2548
|
+
has: options?.has,
|
|
2549
|
+
embed_type: options?.embedType,
|
|
2550
|
+
embed_provider: options?.embedProvider,
|
|
2551
|
+
link_hostname: options?.linkHostname,
|
|
2552
|
+
attachment_filename: options?.attachmentFilename,
|
|
2553
|
+
attachment_extension: options?.attachmentExtension,
|
|
2554
|
+
sort_by: options?.sortBy,
|
|
2555
|
+
sort_order: options?.sortOrder,
|
|
2556
|
+
include_nsfw: options?.includeNfsw,
|
|
2557
|
+
},
|
|
2558
|
+
});
|
|
2559
|
+
return {
|
|
2560
|
+
doingDeepHistoricalIndex: response.doing_deep_historical_index,
|
|
2561
|
+
documentsIndexed: response.documents_indexed,
|
|
2562
|
+
totalResults: response.total_results,
|
|
2563
|
+
messages: response.messages.map((message) => transformers_1.Messages.messageFromRaw(message)),
|
|
2564
|
+
threads: response.threads?.map((thread) => transformers_1.Channels.channelFromRaw(thread)),
|
|
2565
|
+
members: response.members?.map((member) => transformers_1.Channels.threadMemberFromRaw(member)),
|
|
2566
|
+
};
|
|
2567
|
+
}
|
|
2568
|
+
/** https://docs.discord.com/developers/resources/lobby#send-lobby-message */
|
|
2569
|
+
async sendLobbyMessage(lobbyId, options) {
|
|
2570
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbyMessages(lobbyId), {
|
|
2571
|
+
json: options,
|
|
2572
|
+
});
|
|
2573
|
+
return transformers_1.Lobbies.lobbyMessageFromRaw(response);
|
|
2574
|
+
}
|
|
2485
2575
|
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
|
2486
2576
|
sendSoundboardSound(channelId, options) {
|
|
2487
2577
|
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.sendSoundboardSound(channelId), {
|
|
@@ -2495,6 +2585,13 @@ class Client extends node_events_1.default {
|
|
|
2495
2585
|
setPresence(options) {
|
|
2496
2586
|
this.shards.forEach((shard) => shard.transmitter.updatePresence(options));
|
|
2497
2587
|
}
|
|
2588
|
+
/** https://docs.discord.com/developers/resources/channel#set-voice-channel-status */
|
|
2589
|
+
setVoiceChannelStatus(channelId, options, reason) {
|
|
2590
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelVoiceStatus(channelId), {
|
|
2591
|
+
json: options,
|
|
2592
|
+
reason,
|
|
2593
|
+
});
|
|
2594
|
+
}
|
|
2498
2595
|
/** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
|
|
2499
2596
|
async syncGuildTemplate(guildId, code) {
|
|
2500
2597
|
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildTemplate(guildId, code));
|
|
@@ -2537,6 +2634,12 @@ class Client extends node_events_1.default {
|
|
|
2537
2634
|
files: [targetUsersFile],
|
|
2538
2635
|
});
|
|
2539
2636
|
}
|
|
2637
|
+
/** https://docs.discord.com/developers/resources/lobby#update-lobby-message-moderation-metadata */
|
|
2638
|
+
updateLobbyMessageModerationMetadata(lobbyId, messageId, metadata) {
|
|
2639
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.lobbyMessageModerationMetadata(lobbyId, messageId), {
|
|
2640
|
+
json: metadata,
|
|
2641
|
+
});
|
|
2642
|
+
}
|
|
2540
2643
|
/** https://discord.com/developers/docs/resources/channel#unpin-message */
|
|
2541
2644
|
unpinMessage(channelId, messageId, reason) {
|
|
2542
2645
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPin(channelId, messageId), {
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -162,6 +162,10 @@ export declare enum SeparatorSpacing {
|
|
|
162
162
|
Small = 1,
|
|
163
163
|
Large = 2
|
|
164
164
|
}
|
|
165
|
+
/** https://docs.discord.com/developers/components/reference#unfurled-media-item-unfurled-media-item-flags */
|
|
166
|
+
export declare enum UnfurledMediaItemFlags {
|
|
167
|
+
IsAnimated = 1
|
|
168
|
+
}
|
|
165
169
|
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-types */
|
|
166
170
|
export declare enum ApplicationIntegrationTypes {
|
|
167
171
|
GuildInstall = 0,
|
|
@@ -270,7 +274,9 @@ export declare enum AuditLogEvents {
|
|
|
270
274
|
OnboardingCreate = 166,
|
|
271
275
|
OnboardingUpdate = 167,
|
|
272
276
|
HomeSettingsCreate = 190,
|
|
273
|
-
HomeSettingsUpdate = 191
|
|
277
|
+
HomeSettingsUpdate = 191,
|
|
278
|
+
VoiceChannelStatusUpdate = 192,
|
|
279
|
+
VoiceChannelStatusDelete = 193
|
|
274
280
|
}
|
|
275
281
|
/** https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types */
|
|
276
282
|
export declare enum TriggerTypes {
|
|
@@ -614,9 +620,21 @@ export declare enum EmbedTypes {
|
|
|
614
620
|
Link = "link",
|
|
615
621
|
PollResult = "poll_result"
|
|
616
622
|
}
|
|
623
|
+
/** https://docs.discord.com/developers/resources/message#embed-object-embed-flags */
|
|
624
|
+
export declare enum EmbedFlags {
|
|
625
|
+
IsContentInventoryEntry = 32
|
|
626
|
+
}
|
|
627
|
+
/** https://docs.discord.com/developers/resources/message#embed-object-embed-media-flags */
|
|
628
|
+
export declare enum EmbedMediaFlags {
|
|
629
|
+
IsAnimated = 32
|
|
630
|
+
}
|
|
617
631
|
/** https://discord.com/developers/docs/resources/message#attachment-object-attachment-flags */
|
|
618
632
|
export declare enum AttachmentFlags {
|
|
619
|
-
|
|
633
|
+
IsClip = 1,
|
|
634
|
+
IsThumbnail = 2,
|
|
635
|
+
IsRemix = 4,
|
|
636
|
+
IsSpoiler = 8,
|
|
637
|
+
IsAnimated = 32
|
|
620
638
|
}
|
|
621
639
|
/** https://discord.com/developers/docs/resources/message#allowed-mentions-object-allowed-mention-types */
|
|
622
640
|
export declare enum AllowedMentionTypes {
|
|
@@ -626,11 +644,43 @@ export declare enum AllowedMentionTypes {
|
|
|
626
644
|
}
|
|
627
645
|
/** https://docs.discord.com/developers/resources/message#base-theme-types */
|
|
628
646
|
export declare enum BaseThemeTypes {
|
|
647
|
+
Unset = 0,
|
|
629
648
|
Dark = 1,
|
|
630
649
|
Light = 2,
|
|
631
650
|
Darker = 3,
|
|
632
651
|
Midnight = 4
|
|
633
652
|
}
|
|
653
|
+
/** https://docs.discord.com/developers/resources/message#search-guild-messages-author-types */
|
|
654
|
+
export declare enum AuthorTypes {
|
|
655
|
+
User = "user",
|
|
656
|
+
Bot = "bot",
|
|
657
|
+
Webhook = "webhook"
|
|
658
|
+
}
|
|
659
|
+
/** https://docs.discord.com/developers/resources/message#search-guild-messages-search-has-types */
|
|
660
|
+
export declare enum SearchHasTypes {
|
|
661
|
+
Image = "image",
|
|
662
|
+
Sound = "sound",
|
|
663
|
+
Video = "video",
|
|
664
|
+
File = "file",
|
|
665
|
+
Sticker = "sticker",
|
|
666
|
+
Embed = "embed",
|
|
667
|
+
Link = "link",
|
|
668
|
+
Poll = "poll",
|
|
669
|
+
Snapshot = "snapshot"
|
|
670
|
+
}
|
|
671
|
+
/** https://docs.discord.com/developers/resources/message#search-guild-messages-search-embed-types */
|
|
672
|
+
export declare enum SearchEmbedTypes {
|
|
673
|
+
Image = "image",
|
|
674
|
+
Video = "video",
|
|
675
|
+
GIF = "gif",
|
|
676
|
+
Sound = "sound",
|
|
677
|
+
Article = "article"
|
|
678
|
+
}
|
|
679
|
+
/** https://docs.discord.com/developers/resources/message#search-guild-messages-search-sort-modes */
|
|
680
|
+
export declare enum SearchSortModes {
|
|
681
|
+
Timestamp = "timestamp",
|
|
682
|
+
Relevance = "relevance"
|
|
683
|
+
}
|
|
634
684
|
/** https://discord.com/developers/docs/resources/message#get-reactions-reaction-types */
|
|
635
685
|
export declare enum ReactionTypes {
|
|
636
686
|
Normal = 0,
|
|
@@ -719,8 +769,8 @@ export declare enum VisibilityTypes {
|
|
|
719
769
|
/** https://discord.com/developers/docs/resources/subscription#subscription-statuses */
|
|
720
770
|
export declare enum SubscriptionStatuses {
|
|
721
771
|
Active = 0,
|
|
722
|
-
|
|
723
|
-
|
|
772
|
+
Inactive = 1,
|
|
773
|
+
Ending = 2
|
|
724
774
|
}
|
|
725
775
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */
|
|
726
776
|
export declare enum WebhookTypes {
|
|
@@ -782,6 +832,7 @@ export declare enum GatewayEvents {
|
|
|
782
832
|
ChannelCreate = "CHANNEL_CREATE",
|
|
783
833
|
ChannelUpdate = "CHANNEL_UPDATE",
|
|
784
834
|
ChannelDelete = "CHANNEL_DELETE",
|
|
835
|
+
ChannelInfo = "CHANNEL_INFO",
|
|
785
836
|
ChannelPinsUpdate = "CHANNEL_PINS_UPDATE",
|
|
786
837
|
ThreadCreate = "THREAD_CREATE",
|
|
787
838
|
ThreadUpdate = "THREAD_UPDATE",
|
|
@@ -842,6 +893,8 @@ export declare enum GatewayEvents {
|
|
|
842
893
|
TypingStart = "TYPING_START",
|
|
843
894
|
UserUpdate = "USER_UPDATE",
|
|
844
895
|
VoiceChannelEffectSend = "VOICE_CHANNEL_EFFECT_SEND",
|
|
896
|
+
VoiceChannelStartTimeUpdate = "VOICE_CHANNEL_START_TIME_UPDATE",
|
|
897
|
+
VoiceChannelStatusUpdate = "VOICE_CHANNEL_STATUS_UPDATE",
|
|
845
898
|
VoiceStateUpdate = "VOICE_STATE_UPDATE",
|
|
846
899
|
VoiceServerUpdate = "VOICE_SERVER_UPDATE",
|
|
847
900
|
WebhooksUpdate = "WEBHOOKS_UPDATE",
|
|
@@ -894,6 +947,7 @@ export declare enum OAuth2Scopes {
|
|
|
894
947
|
GuildsJoin = "guilds.join",
|
|
895
948
|
GuildsMembersRead = "guilds.members.read",
|
|
896
949
|
Identify = "identify",
|
|
950
|
+
IdentifyPremium = "identify.premium",
|
|
897
951
|
MessagesRead = "messages.read",
|
|
898
952
|
RelationShipsRead = "relationships.read",
|
|
899
953
|
RoleConnectionsWrite = "role_connections.write",
|
|
@@ -918,7 +972,8 @@ export declare enum GatewayOPCodes {
|
|
|
918
972
|
InvalidSession = 9,
|
|
919
973
|
Hello = 10,
|
|
920
974
|
HeartbeatACK = 11,
|
|
921
|
-
RequestSoundboardSounds = 31
|
|
975
|
+
RequestSoundboardSounds = 31,
|
|
976
|
+
RequestChannelInfo = 43
|
|
922
977
|
}
|
|
923
978
|
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes */
|
|
924
979
|
export declare enum GatewayCloseEventCodes {
|
|
@@ -1038,8 +1093,8 @@ export declare enum JSONErrorCodes {
|
|
|
1038
1093
|
OnlyBotsCanUseThisEndpoint = 20002,
|
|
1039
1094
|
ExplicitContentCannotBeSentToTheDesiredRecipient = 20009,
|
|
1040
1095
|
NotAuthorizedToPerformThisActionOnThisApplication = 20012,
|
|
1096
|
+
ThisActionRequiresAPremiumSubscription = 20015,
|
|
1041
1097
|
ActionCannotBePerformedDueToSlowmodeRateLimit = 20016,
|
|
1042
|
-
TheMazeIsntMeantForYou = 20017,
|
|
1043
1098
|
OnlyTheOwnerOfThisAccountCanPerformThisAction = 20018,
|
|
1044
1099
|
AnnouncementEditLimitExceeded = 20022,
|
|
1045
1100
|
UnderMinimumAge = 20024,
|
|
@@ -1171,13 +1226,17 @@ export declare enum JSONErrorCodes {
|
|
|
1171
1226
|
VoiceMessagesMustHaveSupportingMetadata = 50161,
|
|
1172
1227
|
VoiceMessagesCannotBeEdited = 50162,
|
|
1173
1228
|
CannotDeleteGuildSubscriptionIntegration = 50163,
|
|
1229
|
+
CannotSendVoiceEffectWhenUserIsServerMutedDeafenedOrSuppressed = 50167,
|
|
1174
1230
|
YouCannotSendVoiceMessagesInThisChannel = 50173,
|
|
1175
1231
|
TheUserAccountMustFirstBeVerified = 50178,
|
|
1176
1232
|
TheProvidedFileDoesNotHaveAValidDuration = 50192,
|
|
1233
|
+
CannotSendMessagesToThisUserDueToHavingNoMutualGuilds = 50278,
|
|
1177
1234
|
YouDoNotHavePermissionToSendThisSticker = 50600,
|
|
1178
1235
|
TwoFactorAuthenticationIsRequired = 60003,
|
|
1179
1236
|
NoUsersWithDiscordTagExist = 80004,
|
|
1180
1237
|
ReactionWasBlocked = 90001,
|
|
1238
|
+
UserCannotUseBurstReactions = 90002,
|
|
1239
|
+
IndexNotYetAvailable = 110000,
|
|
1181
1240
|
ApplicationNotYetAvailable = 110001,
|
|
1182
1241
|
APIResourceOverloaded = 130000,
|
|
1183
1242
|
TheStageIsAlreadyOpen = 150006,
|
|
@@ -1186,6 +1245,7 @@ export declare enum JSONErrorCodes {
|
|
|
1186
1245
|
ThreadLocked = 160005,
|
|
1187
1246
|
MaximumActiveThreads = 160006,
|
|
1188
1247
|
MaximumActiveAnnouncementThreads = 160007,
|
|
1248
|
+
YouCannotForwardAMessageWhoseContentYouCannotRead = 160014,
|
|
1189
1249
|
InvalidJSONForUploadedLottieFile = 170001,
|
|
1190
1250
|
UploadedLottiesCannotContainRasterizedImages = 170002,
|
|
1191
1251
|
StickerMaximumFramerateExceeded = 170003,
|
|
@@ -1202,6 +1262,7 @@ export declare enum JSONErrorCodes {
|
|
|
1202
1262
|
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
|
|
1203
1263
|
WebhookServicesCannotBeUsedInForumChannels = 220004,
|
|
1204
1264
|
MessageBlockedByHarmfulLinksFilter = 240000,
|
|
1265
|
+
AccessToJoiningNewServersHasBeenLimitedForTheUser = 340015,
|
|
1205
1266
|
CannotEnableOnboardingRequirementsAreNotMet = 350000,
|
|
1206
1267
|
CannotUpdateOnboardingWhileBelowRequirements = 350001,
|
|
1207
1268
|
AccessToFileUploadsHasBeenLimitedForThisGuild = 400001,
|
|
@@ -1291,6 +1352,7 @@ export declare const BitwisePermissionFlags: {
|
|
|
1291
1352
|
readonly CreateEvents: bigint;
|
|
1292
1353
|
readonly UseExternalSounds: bigint;
|
|
1293
1354
|
readonly SendVoiceMessages: bigint;
|
|
1355
|
+
readonly SetVoiceChannelStatus: bigint;
|
|
1294
1356
|
readonly SendPolls: bigint;
|
|
1295
1357
|
readonly UseExternalApps: bigint;
|
|
1296
1358
|
readonly PinMessages: bigint;
|