oceanic.js 1.11.3-dev.9b252f0 → 1.11.3-dev.c3a8425
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/lib/Constants.d.ts +34 -4
- package/dist/lib/Constants.js +44 -3
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +4 -2
- package/dist/lib/routes/Applications.d.ts +20 -1
- package/dist/lib/routes/Applications.js +66 -4
- package/dist/lib/routes/Interactions.d.ts +3 -3
- package/dist/lib/routes/Interactions.js +20 -4
- package/dist/lib/routes/Webhooks.js +11 -2
- package/dist/lib/structures/Application.d.ts +7 -1
- package/dist/lib/structures/Application.js +10 -1
- package/dist/lib/structures/ApplicationCommand.d.ts +3 -1
- package/dist/lib/structures/ApplicationCommand.js +5 -1
- package/dist/lib/structures/Attachment.d.ts +8 -0
- package/dist/lib/structures/Attachment.js +11 -1
- package/dist/lib/structures/AutocompleteInteraction.d.ts +2 -2
- package/dist/lib/structures/AutocompleteInteraction.js +1 -1
- package/dist/lib/structures/ClientApplication.d.ts +6 -1
- package/dist/lib/structures/ClientApplication.js +8 -1
- package/dist/lib/structures/CommandInteraction.d.ts +10 -4
- package/dist/lib/structures/CommandInteraction.js +19 -5
- package/dist/lib/structures/ComponentInteraction.d.ts +10 -6
- package/dist/lib/structures/ComponentInteraction.js +15 -5
- package/dist/lib/structures/Entitlement.d.ts +2 -2
- package/dist/lib/structures/Entitlement.js +5 -5
- package/dist/lib/structures/Message.d.ts +2 -2
- package/dist/lib/structures/Message.js +25 -16
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +9 -5
- package/dist/lib/structures/ModalSubmitInteraction.js +15 -5
- package/dist/lib/structures/PingInteraction.d.ts +2 -2
- package/dist/lib/structures/Subscription.d.ts +25 -0
- package/dist/lib/structures/Subscription.js +38 -0
- package/dist/lib/types/applications.d.ts +89 -8
- package/dist/lib/types/channels.d.ts +53 -15
- package/dist/lib/types/interactions.d.ts +61 -3
- package/dist/lib/types/json.d.ts +10 -3
- package/dist/lib/types/webhooks.d.ts +5 -2
- package/dist/lib/util/Routes.d.ts +3 -0
- package/dist/lib/util/Routes.js +8 -2
- package/dist/lib/util/Util.js +7 -4
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +5 -2
- package/dist/lib/util/interactions/MessageInteractionResponse.js +9 -7
- package/dist/package.json +1 -1
- package/esm.mjs +2 -0
- package/package.json +1 -1
@@ -3,22 +3,25 @@ import type CommandInteraction from "../../structures/CommandInteraction";
|
|
3
3
|
import type Message from "../../structures/Message";
|
4
4
|
import type ComponentInteraction from "../../structures/ComponentInteraction";
|
5
5
|
import type ModalSubmitInteraction from "../../structures/ModalSubmitInteraction";
|
6
|
+
import type { InteractionCallbackResponse } from "../../types";
|
6
7
|
export type AnyResponseInteraction = CommandInteraction | ComponentInteraction | ModalSubmitInteraction;
|
7
8
|
export type ResponseInteractionChannelType<I extends AnyResponseInteraction> = I extends CommandInteraction<infer T> ? T : I extends ModalSubmitInteraction<infer T> ? T : I extends ComponentInteraction<never, infer T> ? T : never;
|
8
9
|
export default class MessageInteractionResponse<I extends AnyResponseInteraction> {
|
10
|
+
callback: InteractionCallbackResponse | null;
|
9
11
|
interaction: I;
|
10
12
|
message: Message<ResponseInteractionChannelType<I>> | null;
|
11
13
|
type: "initial" | "followup";
|
12
|
-
constructor(interaction: I, message: Message<ResponseInteractionChannelType<I>> | null, type: "initial" | "followup");
|
14
|
+
constructor(interaction: I, message: Message<ResponseInteractionChannelType<I>> | null, type: "initial" | "followup", callback: InteractionCallbackResponse | null);
|
13
15
|
deleteMessage(): Promise<void>;
|
14
16
|
getMessage(): Promise<Message<ResponseInteractionChannelType<I>>>;
|
15
|
-
hasMessage(): this is FollowupMessageInteractionResponse<I>;
|
16
17
|
}
|
17
18
|
export interface InitialMessagedInteractionResponse<I extends AnyResponseInteraction> extends MessageInteractionResponse<I> {
|
19
|
+
callback: InteractionCallbackResponse;
|
18
20
|
message: null;
|
19
21
|
type: "initial";
|
20
22
|
}
|
21
23
|
export interface FollowupMessageInteractionResponse<I extends AnyResponseInteraction> extends MessageInteractionResponse<I> {
|
24
|
+
callback: null;
|
22
25
|
message: Message<ResponseInteractionChannelType<I>>;
|
23
26
|
type: "followup";
|
24
27
|
}
|
@@ -1,28 +1,30 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
class MessageInteractionResponse {
|
4
|
+
callback;
|
4
5
|
message;
|
5
6
|
type;
|
6
|
-
constructor(interaction, message, type) {
|
7
|
+
constructor(interaction, message, type, callback) {
|
7
8
|
this.interaction = interaction;
|
8
9
|
this.message = message;
|
9
10
|
this.type = type;
|
11
|
+
this.callback = callback;
|
10
12
|
}
|
11
13
|
async deleteMessage() {
|
12
|
-
if (this.
|
14
|
+
if (this.message !== null) {
|
13
15
|
return this.interaction.deleteFollowup(this.message.id);
|
14
16
|
}
|
15
17
|
return this.interaction.deleteOriginal();
|
16
18
|
}
|
17
19
|
async getMessage() {
|
18
|
-
if (this.
|
20
|
+
if (this.message !== null) {
|
19
21
|
return this.message;
|
20
22
|
}
|
23
|
+
if (this.callback?.resource?.message) {
|
24
|
+
return this.callback.resource.message;
|
25
|
+
}
|
21
26
|
return this.interaction.getOriginal();
|
22
27
|
}
|
23
|
-
hasMessage() {
|
24
|
-
return this.message !== null;
|
25
|
-
}
|
26
28
|
}
|
27
29
|
exports.default = MessageInteractionResponse;
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWVzc2FnZUludGVyYWN0aW9uUmVzcG9uc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWIvdXRpbC9pbnRlcmFjdGlvbnMvTWVzc2FnZUludGVyYWN0aW9uUmVzcG9uc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QU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dist/package.json
CHANGED
package/esm.mjs
CHANGED
@@ -67,6 +67,7 @@ const Shard = (await import("./dist/lib/gateway/Shard.js")).default.default;
|
|
67
67
|
const ShardManager = (await import("./dist/lib/gateway/ShardManager.js")).default.default;
|
68
68
|
const StageChannel = (await import("./dist/lib/structures/StageChannel.js")).default.default;
|
69
69
|
const StageInstance = (await import("./dist/lib/structures/StageInstance.js")).default.default;
|
70
|
+
const Subscription = (await import("./dist/lib/structures/Subscription.js")).default.default;
|
70
71
|
const Team = (await import("./dist/lib/structures/Team.js")).default.default;
|
71
72
|
const TestEntitlement = (await import("./dist/lib/structures/TestEntitlement.js")).default.default;
|
72
73
|
const TextableChannel = (await import("./dist/lib/structures/TextableChannel.js")).default.default;
|
@@ -156,6 +157,7 @@ export {
|
|
156
157
|
ShardManager,
|
157
158
|
StageChannel,
|
158
159
|
StageInstance,
|
160
|
+
Subscription,
|
159
161
|
Team,
|
160
162
|
TestEntitlement,
|
161
163
|
TextableChannel,
|