seyfert 2.1.1-dev-11640269273.0 → 2.1.1-dev-11650796728.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client/base.d.ts +2 -0
- package/lib/client/base.js +2 -0
- package/lib/commands/applications/chatcontext.d.ts +1 -1
- package/lib/commands/applications/chatcontext.js +1 -2
- package/lib/commands/applications/entrycontext.d.ts +6 -6
- package/lib/commands/applications/menucontext.d.ts +6 -6
- package/lib/common/shorters/interaction.d.ts +2 -2
- package/lib/common/shorters/voiceStates.d.ts +5 -0
- package/lib/common/shorters/voiceStates.js +17 -0
- package/lib/common/shorters/webhook.d.ts +2 -2
- package/lib/common/shorters/webhook.js +2 -2
- package/lib/components/componentcontext.d.ts +9 -5
- package/lib/components/componentcontext.js +8 -2
- package/lib/components/modalcontext.d.ts +9 -5
- package/lib/components/modalcontext.js +8 -2
- package/lib/structures/Interaction.d.ts +2 -2
- package/lib/structures/Message.d.ts +2 -1
- package/lib/structures/Message.js +4 -1
- package/lib/structures/VoiceState.js +2 -6
- package/package.json +1 -1
package/lib/client/base.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { CommandHandler } from '../commands/handler';
|
|
|
7
7
|
import { ApplicationShorter, ChannelShorter, EmojiShorter, GuildShorter, InteractionShorter, Logger, type MakeRequired, MemberShorter, MessageShorter, ReactionShorter, RoleShorter, TemplateShorter, ThreadShorter, UsersShorter, WebhookShorter } from '../common';
|
|
8
8
|
import { HandleCommand } from '../commands/handle';
|
|
9
9
|
import { BanShorter } from '../common/shorters/bans';
|
|
10
|
+
import { VoiceStateShorter } from '../common/shorters/voiceStates';
|
|
10
11
|
import type { Awaitable, DeepPartial, IntentStrings, OmitInsert, PermissionStrings, When } from '../common/types/util';
|
|
11
12
|
import type { ComponentCommand, ModalCommand } from '../components';
|
|
12
13
|
import { ComponentHandler } from '../components/handler';
|
|
@@ -31,6 +32,7 @@ export declare class BaseClient {
|
|
|
31
32
|
threads: ThreadShorter;
|
|
32
33
|
bans: BanShorter;
|
|
33
34
|
interactions: InteractionShorter;
|
|
35
|
+
voiceStates: VoiceStateShorter;
|
|
34
36
|
debugger?: Logger;
|
|
35
37
|
logger: Logger;
|
|
36
38
|
langs?: LangsHandler | undefined;
|
package/lib/client/base.js
CHANGED
|
@@ -10,6 +10,7 @@ const common_1 = require("../common");
|
|
|
10
10
|
const node_fs_1 = require("node:fs");
|
|
11
11
|
const handle_1 = require("../commands/handle");
|
|
12
12
|
const bans_1 = require("../common/shorters/bans");
|
|
13
|
+
const voiceStates_1 = require("../common/shorters/voiceStates");
|
|
13
14
|
const handler_2 = require("../components/handler");
|
|
14
15
|
const handler_3 = require("../langs/handler");
|
|
15
16
|
class BaseClient {
|
|
@@ -29,6 +30,7 @@ class BaseClient {
|
|
|
29
30
|
threads = new common_1.ThreadShorter(this);
|
|
30
31
|
bans = new bans_1.BanShorter(this);
|
|
31
32
|
interactions = new common_1.InteractionShorter(this);
|
|
33
|
+
voiceStates = new voiceStates_1.VoiceStateShorter(this);
|
|
32
34
|
debugger;
|
|
33
35
|
logger = new common_1.Logger({
|
|
34
36
|
name: '[Seyfert]',
|
|
@@ -31,7 +31,7 @@ export declare class CommandContext<T extends OptionsRecord = {}, M extends keyo
|
|
|
31
31
|
editResponse(body: InteractionMessageUpdateBodyRequest): Promise<When<InferWithPrefix, WebhookMessageStructure | MessageStructure, WebhookMessageStructure>>;
|
|
32
32
|
deleteResponse(): Promise<void>;
|
|
33
33
|
editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<When<WR, WebhookMessageStructure | When<InferWithPrefix, MessageStructure, never>, void | WebhookMessageStructure | When<InferWithPrefix, MessageStructure, never>>>;
|
|
34
|
-
fetchResponse(): Promise<If<InferWithPrefix, WebhookMessageStructure | MessageStructure
|
|
34
|
+
fetchResponse(): Promise<If<InferWithPrefix, WebhookMessageStructure | MessageStructure, WebhookMessageStructure>>;
|
|
35
35
|
channel(mode?: 'rest' | 'flow'): Promise<If<InferWithPrefix, AllChannels | undefined, AllChannels>>;
|
|
36
36
|
channel(mode?: 'cache'): ReturnCache<If<InferWithPrefix, AllChannels | undefined, AllChannels>>;
|
|
37
37
|
me(mode?: 'rest' | 'flow'): Promise<GuildMemberStructure>;
|
|
@@ -78,8 +78,7 @@ class CommandContext extends basecontext_1.BaseContext {
|
|
|
78
78
|
async fetchResponse() {
|
|
79
79
|
if (this.interaction)
|
|
80
80
|
return this.interaction.fetchResponse();
|
|
81
|
-
this.messageResponse = await this.messageResponse
|
|
82
|
-
return this.messageResponse;
|
|
81
|
+
return (this.messageResponse = (await this.messageResponse.fetch()));
|
|
83
82
|
}
|
|
84
83
|
channel(mode = 'cache') {
|
|
85
84
|
if (this.interaction?.channel && mode === 'cache')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReturnCache } from '../..';
|
|
2
|
-
import type { GuildMemberStructure, GuildStructure
|
|
3
|
-
import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, ModalCreateBodyRequest, UnionToTuple
|
|
2
|
+
import type { GuildMemberStructure, GuildStructure } from '../../client/transformers';
|
|
3
|
+
import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, ModalCreateBodyRequest, UnionToTuple } from '../../common';
|
|
4
4
|
import type { AllChannels, EntryPointInteraction } from '../../structures';
|
|
5
5
|
import { BaseContext } from '../basecontext';
|
|
6
6
|
import type { RegisteredMiddlewares } from '../decorators';
|
|
@@ -20,13 +20,13 @@ export declare class EntryPointContext<M extends keyof RegisteredMiddlewares = n
|
|
|
20
20
|
get(locale?: string): import("./shared").DefaultLocale;
|
|
21
21
|
};
|
|
22
22
|
get fullCommandName(): string;
|
|
23
|
-
write<WR extends boolean = false>(body: InteractionCreateBodyRequest, withResponse?: WR): Promise<When<WR,
|
|
23
|
+
write<WR extends boolean = false>(body: InteractionCreateBodyRequest, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, void>>;
|
|
24
24
|
modal(body: ModalCreateBodyRequest): Promise<undefined>;
|
|
25
|
-
deferReply<WR extends boolean = false>(ephemeral?: boolean, withResponse?: WR): Promise<When<WR,
|
|
25
|
+
deferReply<WR extends boolean = false>(ephemeral?: boolean, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, undefined>>;
|
|
26
26
|
editResponse(body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
|
|
27
27
|
deleteResponse(): Promise<void | undefined>;
|
|
28
|
-
editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<When<WR,
|
|
29
|
-
fetchResponse(): Promise<import("../..").WebhookMessage
|
|
28
|
+
editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, void>>;
|
|
29
|
+
fetchResponse(): Promise<import("../..").WebhookMessage>;
|
|
30
30
|
channel(mode?: 'rest' | 'flow'): Promise<AllChannels>;
|
|
31
31
|
channel(mode?: 'cache'): ReturnCache<AllChannels>;
|
|
32
32
|
me(mode?: 'rest' | 'flow'): Promise<GuildMemberStructure>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ContextMenuCommand, ReturnCache } from '../..';
|
|
2
|
-
import { type GuildMemberStructure, type GuildStructure, type MessageStructure, type UserStructure
|
|
3
|
-
import { type InteractionCreateBodyRequest, type InteractionMessageUpdateBodyRequest, type MakeRequired, type ModalCreateBodyRequest, type UnionToTuple
|
|
2
|
+
import { type GuildMemberStructure, type GuildStructure, type MessageStructure, type UserStructure } from '../../client/transformers';
|
|
3
|
+
import { type InteractionCreateBodyRequest, type InteractionMessageUpdateBodyRequest, type MakeRequired, type ModalCreateBodyRequest, type UnionToTuple } from '../../common';
|
|
4
4
|
import type { AllChannels, MessageCommandInteraction, UserCommandInteraction } from '../../structures';
|
|
5
5
|
import { BaseContext } from '../basecontext';
|
|
6
6
|
import type { RegisteredMiddlewares } from '../decorators';
|
|
@@ -21,13 +21,13 @@ export declare class MenuCommandContext<T extends MessageCommandInteraction | Us
|
|
|
21
21
|
get(locale?: string): import("./shared").DefaultLocale;
|
|
22
22
|
};
|
|
23
23
|
get fullCommandName(): string;
|
|
24
|
-
write<WR extends boolean = false>(body: InteractionCreateBodyRequest, withResponse?: WR): Promise<When<WR,
|
|
24
|
+
write<WR extends boolean = false>(body: InteractionCreateBodyRequest, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, void>>;
|
|
25
25
|
modal(body: ModalCreateBodyRequest): Promise<undefined>;
|
|
26
|
-
deferReply<WR extends boolean = false>(ephemeral?: boolean, withResponse?: WR): Promise<When<WR,
|
|
26
|
+
deferReply<WR extends boolean = false>(ephemeral?: boolean, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, undefined>>;
|
|
27
27
|
editResponse(body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
|
|
28
28
|
deleteResponse(): Promise<void | undefined>;
|
|
29
|
-
editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<When<WR,
|
|
30
|
-
fetchResponse(): Promise<import("../..").WebhookMessage
|
|
29
|
+
editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, void>>;
|
|
30
|
+
fetchResponse(): Promise<import("../..").WebhookMessage>;
|
|
31
31
|
channel(mode?: 'rest' | 'flow'): Promise<AllChannels>;
|
|
32
32
|
channel(mode?: 'cache'): ReturnCache<AllChannels>;
|
|
33
33
|
me(mode?: 'rest' | 'flow'): Promise<GuildMemberStructure>;
|
|
@@ -3,8 +3,8 @@ import type { InteractionMessageUpdateBodyRequest, MessageWebhookCreateBodyReque
|
|
|
3
3
|
import { BaseShorter } from './base';
|
|
4
4
|
export declare class InteractionShorter extends BaseShorter {
|
|
5
5
|
reply(id: string, token: string, body: ReplyInteractionBody, withResponse?: boolean): Promise<import("../../types").RESTPostAPIInteractionCallbackResult | undefined>;
|
|
6
|
-
fetchResponse(token: string, messageId: string): Promise<import("../..").WebhookMessage
|
|
7
|
-
fetchOriginal(token: string): Promise<import("../..").WebhookMessage
|
|
6
|
+
fetchResponse(token: string, messageId: string): Promise<import("../..").WebhookMessage>;
|
|
7
|
+
fetchOriginal(token: string): Promise<import("../..").WebhookMessage>;
|
|
8
8
|
editMessage(token: string, messageId: string, body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
|
|
9
9
|
editOriginal(token: string, body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
|
|
10
10
|
deleteResponse(token: string, messageId: string): Promise<void | undefined>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VoiceStateShorter = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
class VoiceStateShorter extends base_1.BaseShorter {
|
|
6
|
+
requestSpeak(guildId, date) {
|
|
7
|
+
return this.client.proxy.guilds(guildId)['voice-states']['@me'].patch({
|
|
8
|
+
body: { request_to_speak_timestamp: date },
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
setSuppress(guildId, suppress) {
|
|
12
|
+
return this.client.proxy.guilds(guildId)['voice-states']['@me'].patch({
|
|
13
|
+
body: { suppress },
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.VoiceStateShorter = VoiceStateShorter;
|
|
@@ -57,9 +57,9 @@ export declare class WebhookShorter extends BaseShorter {
|
|
|
57
57
|
* @param token The token of the webhook.
|
|
58
58
|
* @param messageId The ID of the message to fetch.
|
|
59
59
|
* @param threadId The ID of the thread the message belongs to.
|
|
60
|
-
* @returns A Promise that resolves to the fetched message
|
|
60
|
+
* @returns A Promise that resolves to the fetched message
|
|
61
61
|
*/
|
|
62
|
-
fetchMessage(webhookId: string, token: string, messageId: string, threadId?: string): Promise<import("../../structures").WebhookMessage
|
|
62
|
+
fetchMessage(webhookId: string, token: string, messageId: string, threadId?: string): Promise<import("../../structures").WebhookMessage>;
|
|
63
63
|
listFromGuild(guildId: string): Promise<import("../../structures").Webhook[]>;
|
|
64
64
|
listFromChannel(channelId: string): Promise<import("../../structures").Webhook[]>;
|
|
65
65
|
}
|
|
@@ -110,14 +110,14 @@ class WebhookShorter extends base_1.BaseShorter {
|
|
|
110
110
|
* @param token The token of the webhook.
|
|
111
111
|
* @param messageId The ID of the message to fetch.
|
|
112
112
|
* @param threadId The ID of the thread the message belongs to.
|
|
113
|
-
* @returns A Promise that resolves to the fetched message
|
|
113
|
+
* @returns A Promise that resolves to the fetched message
|
|
114
114
|
*/
|
|
115
115
|
async fetchMessage(webhookId, token, messageId, threadId) {
|
|
116
116
|
const message = await this.client.proxy
|
|
117
117
|
.webhooks(webhookId)(token)
|
|
118
118
|
.messages(messageId)
|
|
119
119
|
.get({ auth: false, query: threadId ? { thread_id: threadId } : undefined });
|
|
120
|
-
return
|
|
120
|
+
return transformers_1.Transformers.WebhookMessage(this.client, message, webhookId, token);
|
|
121
121
|
}
|
|
122
122
|
async listFromGuild(guildId) {
|
|
123
123
|
const webhooks = await this.client.proxy.guilds(guildId).webhooks.get();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AllChannels, ButtonInteraction, ChannelSelectMenuInteraction, ComponentCommand, MentionableSelectMenuInteraction, ReturnCache, RoleSelectMenuInteraction, StringSelectMenuInteraction, UserSelectMenuInteraction } from '..';
|
|
2
|
-
import type { GuildMemberStructure, GuildStructure
|
|
2
|
+
import type { GuildMemberStructure, GuildStructure } from '../client/transformers';
|
|
3
3
|
import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands';
|
|
4
4
|
import { BaseContext } from '../commands/basecontext';
|
|
5
|
-
import type { ComponentInteractionMessageUpdate, InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, ModalCreateBodyRequest, UnionToTuple
|
|
5
|
+
import type { ComponentInteractionMessageUpdate, InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, ModalCreateBodyRequest, UnionToTuple } from '../common';
|
|
6
6
|
export interface ComponentContext<Type extends keyof ContextComponentCommandInteractionMap = keyof ContextComponentCommandInteractionMap> extends BaseContext, ExtendContext {
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -36,12 +36,12 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
|
|
|
36
36
|
* @param body - The body of the response.
|
|
37
37
|
* @param fetchReply - Whether to fetch the reply or not.
|
|
38
38
|
*/
|
|
39
|
-
write<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<When<FR, import("..").WebhookMessage, void>>;
|
|
39
|
+
write<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<import("../common").When<FR, import("..").WebhookMessage, void>>;
|
|
40
40
|
/**
|
|
41
41
|
* Defers the reply to the interaction.
|
|
42
42
|
* @param ephemeral - Whether the reply should be ephemeral or not.
|
|
43
43
|
*/
|
|
44
|
-
deferReply(ephemeral?: boolean): Promise<undefined
|
|
44
|
+
deferReply<FR extends boolean = false>(ephemeral?: boolean, fetchReply?: FR): Promise<import("../common").When<FR, import("..").WebhookMessage, undefined>>;
|
|
45
45
|
/**
|
|
46
46
|
* ACK an interaction and edit the original message later; the user does not see a loading state
|
|
47
47
|
*/
|
|
@@ -61,7 +61,11 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
|
|
|
61
61
|
* @param body - The body of the response or updated body of the interaction.
|
|
62
62
|
* @param fetchReply - Whether to fetch the reply or not.
|
|
63
63
|
*/
|
|
64
|
-
editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, fetchReply?: FR): Promise<When<FR,
|
|
64
|
+
editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, fetchReply?: FR): Promise<import("../common").When<FR, import("..").WebhookMessage, void>>;
|
|
65
|
+
/**
|
|
66
|
+
* @returns A Promise that resolves to the fetched message
|
|
67
|
+
*/
|
|
68
|
+
fetchResponse(): Promise<import("..").WebhookMessage>;
|
|
65
69
|
/**
|
|
66
70
|
* Deletes the response of the interaction.
|
|
67
71
|
* @returns A promise that resolves when the response is deleted.
|
|
@@ -47,8 +47,8 @@ class ComponentContext extends basecontext_1.BaseContext {
|
|
|
47
47
|
* Defers the reply to the interaction.
|
|
48
48
|
* @param ephemeral - Whether the reply should be ephemeral or not.
|
|
49
49
|
*/
|
|
50
|
-
deferReply(ephemeral = false) {
|
|
51
|
-
return this.interaction.deferReply(ephemeral ? types_1.MessageFlags.Ephemeral : undefined);
|
|
50
|
+
deferReply(ephemeral = false, fetchReply) {
|
|
51
|
+
return this.interaction.deferReply(ephemeral ? types_1.MessageFlags.Ephemeral : undefined, fetchReply);
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* ACK an interaction and edit the original message later; the user does not see a loading state
|
|
@@ -78,6 +78,12 @@ class ComponentContext extends basecontext_1.BaseContext {
|
|
|
78
78
|
editOrReply(body, fetchReply) {
|
|
79
79
|
return this.interaction.editOrReply(body, fetchReply);
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* @returns A Promise that resolves to the fetched message
|
|
83
|
+
*/
|
|
84
|
+
fetchResponse() {
|
|
85
|
+
return this.interaction.fetchResponse();
|
|
86
|
+
}
|
|
81
87
|
/**
|
|
82
88
|
* Deletes the response of the interaction.
|
|
83
89
|
* @returns A promise that resolves when the response is deleted.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AllChannels, ModalCommand, ModalSubmitInteraction, ReturnCache } from '..';
|
|
2
|
-
import type { GuildMemberStructure, GuildStructure
|
|
2
|
+
import type { GuildMemberStructure, GuildStructure } from '../client/transformers';
|
|
3
3
|
import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands';
|
|
4
4
|
import { BaseContext } from '../commands/basecontext';
|
|
5
|
-
import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, ModalCreateBodyRequest, UnionToTuple
|
|
5
|
+
import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, ModalCreateBodyRequest, UnionToTuple } from '../common';
|
|
6
6
|
export interface ModalContext extends BaseContext, ExtendContext {
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -41,12 +41,12 @@ export declare class ModalContext<M extends keyof RegisteredMiddlewares = never>
|
|
|
41
41
|
* @param body - The body of the response.
|
|
42
42
|
* @param fetchReply - Whether to fetch the reply or not.
|
|
43
43
|
*/
|
|
44
|
-
write<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<When<FR, import("..").WebhookMessage, void>>;
|
|
44
|
+
write<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<import("../common").When<FR, import("..").WebhookMessage, void>>;
|
|
45
45
|
/**
|
|
46
46
|
* Defers the reply to the interaction.
|
|
47
47
|
* @param ephemeral - Whether the reply should be ephemeral or not.
|
|
48
48
|
*/
|
|
49
|
-
deferReply(ephemeral?: boolean): Promise<undefined
|
|
49
|
+
deferReply<FR extends boolean = false>(ephemeral?: boolean, fetchReply?: FR): Promise<import("../common").When<FR, import("..").WebhookMessage, undefined>>;
|
|
50
50
|
/**
|
|
51
51
|
* Edits the response of the interaction.
|
|
52
52
|
* @param body - The updated body of the response.
|
|
@@ -57,7 +57,11 @@ export declare class ModalContext<M extends keyof RegisteredMiddlewares = never>
|
|
|
57
57
|
* @param body - The body of the response or updated body of the interaction.
|
|
58
58
|
* @param fetchReply - Whether to fetch the reply or not.
|
|
59
59
|
*/
|
|
60
|
-
editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, fetchReply?: FR): Promise<When<FR,
|
|
60
|
+
editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, fetchReply?: FR): Promise<import("../common").When<FR, import("..").WebhookMessage, void>>;
|
|
61
|
+
/**
|
|
62
|
+
* @returns A Promise that resolves to the fetched message
|
|
63
|
+
*/
|
|
64
|
+
fetchResponse(): Promise<import("..").WebhookMessage>;
|
|
61
65
|
/**
|
|
62
66
|
* Deletes the response of the interaction.
|
|
63
67
|
* @returns A promise that resolves when the response is deleted.
|
|
@@ -47,8 +47,8 @@ class ModalContext extends basecontext_1.BaseContext {
|
|
|
47
47
|
* Defers the reply to the interaction.
|
|
48
48
|
* @param ephemeral - Whether the reply should be ephemeral or not.
|
|
49
49
|
*/
|
|
50
|
-
deferReply(ephemeral = false) {
|
|
51
|
-
return this.interaction.deferReply(ephemeral ? types_1.MessageFlags.Ephemeral : undefined);
|
|
50
|
+
deferReply(ephemeral = false, fetchReply) {
|
|
51
|
+
return this.interaction.deferReply(ephemeral ? types_1.MessageFlags.Ephemeral : undefined, fetchReply);
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Edits the response of the interaction.
|
|
@@ -65,6 +65,12 @@ class ModalContext extends basecontext_1.BaseContext {
|
|
|
65
65
|
editOrReply(body, fetchReply) {
|
|
66
66
|
return this.interaction.editOrReply(body, fetchReply);
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @returns A Promise that resolves to the fetched message
|
|
70
|
+
*/
|
|
71
|
+
fetchResponse() {
|
|
72
|
+
return this.interaction.fetchResponse();
|
|
73
|
+
}
|
|
68
74
|
/**
|
|
69
75
|
* Deletes the response of the interaction.
|
|
70
76
|
* @returns A promise that resolves when the response is deleted.
|
|
@@ -69,8 +69,8 @@ export declare class AutocompleteInteraction<FromGuild extends boolean = boolean
|
|
|
69
69
|
reply(..._args: unknown[]): Promise<any>;
|
|
70
70
|
}
|
|
71
71
|
export declare class Interaction<FromGuild extends boolean = boolean, Type extends APIInteraction = APIInteraction> extends BaseInteraction<FromGuild, Type> {
|
|
72
|
-
fetchMessage(messageId: string): Promise<import("./Message").WebhookMessage
|
|
73
|
-
fetchResponse(): Promise<import("./Message").WebhookMessage
|
|
72
|
+
fetchMessage(messageId: string): Promise<import("./Message").WebhookMessage>;
|
|
73
|
+
fetchResponse(): Promise<import("./Message").WebhookMessage>;
|
|
74
74
|
write<FR extends boolean = false>(body: InteractionCreateBodyRequest, withResponse?: FR): Promise<When<FR, WebhookMessageStructure, void>>;
|
|
75
75
|
modal(body: ModalCreateBodyRequest): Promise<undefined>;
|
|
76
76
|
editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<When<FR, WebhookMessageStructure, void>>;
|
|
@@ -52,7 +52,8 @@ export declare class WebhookMessage extends BaseMessage {
|
|
|
52
52
|
readonly webhookId: string;
|
|
53
53
|
readonly webhookToken: string;
|
|
54
54
|
constructor(client: UsingClient, data: MessageData, webhookId: string, webhookToken: string);
|
|
55
|
-
|
|
55
|
+
fetchWebhook(): Promise<import("./Webhook").Webhook>;
|
|
56
|
+
fetch(): Promise<WebhookMessage>;
|
|
56
57
|
edit(body: EditMessageWebhook): Promise<WebhookMessage>;
|
|
57
58
|
write(body: WriteMessageWebhook): Promise<WebhookMessage | null>;
|
|
58
59
|
delete(reason?: string): Promise<never>;
|
|
@@ -104,8 +104,11 @@ class WebhookMessage extends BaseMessage {
|
|
|
104
104
|
this.webhookId = webhookId;
|
|
105
105
|
this.webhookToken = webhookToken;
|
|
106
106
|
}
|
|
107
|
+
fetchWebhook() {
|
|
108
|
+
return this.client.webhooks.fetch(this.webhookId, this.webhookToken);
|
|
109
|
+
}
|
|
107
110
|
fetch() {
|
|
108
|
-
return this.
|
|
111
|
+
return this.client.webhooks.fetchMessage(this.webhookId, this.webhookToken, this.id, this.thread?.id);
|
|
109
112
|
}
|
|
110
113
|
edit(body) {
|
|
111
114
|
const { query, ...rest } = body;
|
|
@@ -37,9 +37,7 @@ class VoiceState extends Base_1.Base {
|
|
|
37
37
|
return member;
|
|
38
38
|
}
|
|
39
39
|
async setSuppress(suppress = !this.suppress) {
|
|
40
|
-
await this.client.
|
|
41
|
-
body: { suppress },
|
|
42
|
-
});
|
|
40
|
+
await this.client.voiceStates.setSuppress(this.guildId, suppress);
|
|
43
41
|
this.suppress = suppress;
|
|
44
42
|
}
|
|
45
43
|
async requestSpeak(date = new Date()) {
|
|
@@ -48,9 +46,7 @@ class VoiceState extends Base_1.Base {
|
|
|
48
46
|
if (Number.isNaN(date))
|
|
49
47
|
return Promise.reject('Invalid date');
|
|
50
48
|
date = date.toISOString();
|
|
51
|
-
await this.client.
|
|
52
|
-
body: { request_to_speak_timestamp: date },
|
|
53
|
-
});
|
|
49
|
+
await this.client.voiceStates.requestSpeak(this.guildId, date);
|
|
54
50
|
this.requestToSpeakTimestamp = date;
|
|
55
51
|
}
|
|
56
52
|
disconnect(reason) {
|