seyfert 2.1.1-dev-11640269273.0 → 2.1.1-dev-11674326808.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/api/api.d.ts CHANGED
@@ -22,7 +22,7 @@ export declare class ApiHandler {
22
22
  get proxy(): APIRoutes;
23
23
  globalUnblock(): void;
24
24
  request<T = unknown>(method: HttpMethods, url: `/${string}`, { auth, ...request }?: ApiRequestOptions): Promise<T>;
25
- parseError(response: Response, result: unknown): Error;
25
+ parseError(route: `/${string}`, response: Response, result: unknown): Error;
26
26
  handle50X(method: HttpMethods, url: `/${string}`, request: ApiRequestOptions, next: () => void): Promise<unknown>;
27
27
  handle429(route: string, method: HttpMethods, url: `/${string}`, request: ApiRequestOptions, response: Response, result: string, next: () => void, reject: (err: unknown) => void, now: number): Promise<unknown>;
28
28
  clearResetInterval(route: string): void;
package/lib/api/api.js CHANGED
@@ -132,7 +132,7 @@ class ApiHandler {
132
132
  }
133
133
  }
134
134
  }
135
- const parsedError = this.parseError(response, result);
135
+ const parsedError = this.parseError(route, response, result);
136
136
  this.debugger?.warn(parsedError);
137
137
  reject(parsedError);
138
138
  return;
@@ -170,7 +170,7 @@ class ApiHandler {
170
170
  }
171
171
  });
172
172
  }
173
- parseError(response, result) {
173
+ parseError(route, response, result) {
174
174
  let errMessage = '';
175
175
  if (typeof result === 'object' && result) {
176
176
  if ('message' in result) {
@@ -180,10 +180,8 @@ class ApiHandler {
180
180
  errMessage += `${JSON.stringify(result.errors, null, 2)}\n`;
181
181
  }
182
182
  }
183
- if (errMessage.length) {
184
- return new Error(errMessage);
185
- }
186
- return new Error(response.statusText);
183
+ errMessage += ` at [${response.status} ${response.statusText}] ${route}`;
184
+ return new Error(errMessage);
187
185
  }
188
186
  async handle50X(method, url, request, next) {
189
187
  const wait = Math.floor(Math.random() * 1900 + 100);
@@ -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;
@@ -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 | undefined, WebhookMessageStructure | undefined>>;
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?.fetch();
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, MessageStructure, WebhookMessageStructure } from '../../client/transformers';
3
- import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, ModalCreateBodyRequest, UnionToTuple, When } from '../../common';
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, WebhookMessageStructure, void | WebhookMessageStructure>>;
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, WebhookMessageStructure, undefined>>;
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, WebhookMessageStructure | MessageStructure, void | WebhookMessageStructure | MessageStructure>>;
29
- fetchResponse(): Promise<import("../..").WebhookMessage | undefined>;
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, type WebhookMessageStructure } from '../../client/transformers';
3
- import { type InteractionCreateBodyRequest, type InteractionMessageUpdateBodyRequest, type MakeRequired, type ModalCreateBodyRequest, type UnionToTuple, type When } from '../../common';
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, WebhookMessageStructure, void | WebhookMessageStructure>>;
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, WebhookMessageStructure, undefined>>;
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, WebhookMessageStructure | MessageStructure, void | WebhookMessageStructure | MessageStructure>>;
30
- fetchResponse(): Promise<import("../..").WebhookMessage | undefined>;
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 | undefined>;
7
- fetchOriginal(token: string): Promise<import("../..").WebhookMessage | undefined>;
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,5 @@
1
+ import { BaseShorter } from './base';
2
+ export declare class VoiceStateShorter extends BaseShorter {
3
+ requestSpeak(guildId: string, date: string): Promise<never>;
4
+ setSuppress(guildId: string, suppress: boolean): Promise<never>;
5
+ }
@@ -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, or undefined if not found.
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 | undefined>;
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, or undefined if not found.
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 message ? transformers_1.Transformers.WebhookMessage(this.client, message, webhookId, token) : undefined;
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, MessageStructure, WebhookMessageStructure } from '../client/transformers';
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, When } from '../common';
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, WebhookMessageStructure | MessageStructure, void | WebhookMessageStructure | MessageStructure>>;
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, MessageStructure, WebhookMessageStructure } from '../client/transformers';
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, When } from '../common';
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, WebhookMessageStructure | MessageStructure, void | WebhookMessageStructure | MessageStructure>>;
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 | undefined>;
73
- fetchResponse(): Promise<import("./Message").WebhookMessage | undefined>;
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
- fetch(): Promise<import("../types").RESTGetAPIWebhookWithTokenResult>;
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.api.webhooks(this.webhookId)(this.webhookToken).get();
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.proxy.guilds(this.guildId)['voice-states']['@me'].patch({
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.proxy.guilds(this.guildId)['voice-states']['@me'].patch({
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "2.1.1-dev-11640269273.0",
3
+ "version": "2.1.1-dev-11674326808.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",