seyfert 2.1.0 → 2.1.1-dev-11310514874.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/Router.d.ts +2 -2
- package/lib/api/Router.js +2 -1
- package/lib/api/Routes/applications.d.ts +29 -30
- package/lib/api/Routes/cdn.d.ts +6 -1
- package/lib/api/Routes/channels.d.ts +44 -45
- package/lib/api/Routes/gateway.d.ts +3 -4
- package/lib/api/Routes/guilds.d.ts +81 -80
- package/lib/api/Routes/index.d.ts +3 -1
- package/lib/api/Routes/interactions.d.ts +6 -6
- package/lib/api/Routes/invites.d.ts +3 -4
- package/lib/api/Routes/skus.d.ts +4 -5
- package/lib/api/Routes/soundboard.d.ts +23 -0
- package/lib/api/Routes/soundboard.js +2 -0
- package/lib/api/Routes/stage-instances.d.ts +5 -6
- package/lib/api/Routes/stickers.d.ts +3 -4
- package/lib/api/Routes/users.d.ts +11 -12
- package/lib/api/Routes/voice.d.ts +2 -3
- package/lib/api/Routes/webhooks.d.ts +16 -15
- package/lib/api/api.d.ts +17 -11
- package/lib/api/api.js +12 -10
- package/lib/api/shared.d.ts +1 -1
- package/lib/api/utils/constants.d.ts +2 -0
- package/lib/api/utils/constants.js +2 -1
- package/lib/builders/ActionRow.d.ts +1 -1
- package/lib/builders/Attachment.d.ts +2 -2
- package/lib/builders/Attachment.js +1 -1
- package/lib/builders/Button.d.ts +1 -1
- package/lib/builders/Button.js +1 -1
- package/lib/builders/Embed.d.ts +1 -1
- package/lib/builders/Embed.js +2 -2
- package/lib/builders/Modal.d.ts +1 -1
- package/lib/builders/Poll.d.ts +1 -1
- package/lib/builders/Poll.js +1 -1
- package/lib/builders/SelectMenu.d.ts +1 -1
- package/lib/builders/SelectMenu.js +1 -1
- package/lib/builders/types.d.ts +2 -1
- package/lib/cache/adapters/default.js +5 -3
- package/lib/cache/adapters/limited.d.ts +1 -2
- package/lib/cache/adapters/limited.js +34 -30
- package/lib/cache/adapters/workeradapter.js +3 -1
- package/lib/cache/index.d.ts +8 -11
- package/lib/cache/index.js +38 -37
- package/lib/cache/resources/bans.d.ts +2 -2
- package/lib/cache/resources/bans.js +1 -1
- package/lib/cache/resources/channels.d.ts +1 -1
- package/lib/cache/resources/default/guild-related.d.ts +1 -2
- package/lib/cache/resources/emojis.d.ts +2 -2
- package/lib/cache/resources/emojis.js +1 -1
- package/lib/cache/resources/guilds.d.ts +2 -2
- package/lib/cache/resources/guilds.js +7 -11
- package/lib/cache/resources/members.d.ts +2 -2
- package/lib/cache/resources/members.js +1 -1
- package/lib/cache/resources/messages.d.ts +2 -2
- package/lib/cache/resources/messages.js +3 -3
- package/lib/cache/resources/overwrites.d.ts +1 -1
- package/lib/cache/resources/roles.d.ts +2 -2
- package/lib/cache/resources/roles.js +1 -1
- package/lib/cache/resources/stickers.d.ts +2 -2
- package/lib/cache/resources/stickers.js +1 -1
- package/lib/cache/resources/users.d.ts +2 -2
- package/lib/cache/resources/users.js +1 -1
- package/lib/cache/resources/voice-states.d.ts +2 -2
- package/lib/cache/resources/voice-states.js +1 -1
- package/lib/client/base.d.ts +9 -14
- package/lib/client/base.js +43 -44
- package/lib/client/client.d.ts +3 -7
- package/lib/client/client.js +24 -41
- package/lib/client/collectors.js +1 -1
- package/lib/client/httpclient.d.ts +1 -1
- package/lib/client/transformers.d.ts +37 -34
- package/lib/client/transformers.js +66 -63
- package/lib/client/workerclient.d.ts +10 -11
- package/lib/client/workerclient.js +180 -75
- package/lib/collection.d.ts +3 -3
- package/lib/commands/applications/chat.d.ts +3 -3
- package/lib/commands/applications/chat.js +5 -6
- package/lib/commands/applications/chatcontext.d.ts +6 -6
- package/lib/commands/applications/chatcontext.js +16 -8
- package/lib/commands/applications/entryPoint.d.ts +1 -1
- package/lib/commands/applications/entrycontext.d.ts +6 -6
- package/lib/commands/applications/entrycontext.js +4 -4
- package/lib/commands/applications/menu.d.ts +1 -1
- package/lib/commands/applications/menucontext.d.ts +5 -5
- package/lib/commands/applications/menucontext.js +6 -6
- package/lib/commands/applications/options.d.ts +4 -4
- package/lib/commands/applications/shared.d.ts +5 -2
- package/lib/commands/basecontext.d.ts +1 -1
- package/lib/commands/decorators.d.ts +10 -10
- package/lib/commands/decorators.js +5 -4
- package/lib/commands/handle.d.ts +9 -9
- package/lib/commands/handle.js +94 -68
- package/lib/commands/handler.d.ts +5 -5
- package/lib/commands/handler.js +21 -17
- package/lib/commands/optionresolver.d.ts +4 -4
- package/lib/commands/optionresolver.js +3 -3
- package/lib/common/it/formatter.d.ts +21 -21
- package/lib/common/it/formatter.js +40 -41
- package/lib/common/it/logger.js +1 -1
- package/lib/common/it/utils.d.ts +4 -3
- package/lib/common/it/utils.js +52 -27
- package/lib/common/shorters/application.d.ts +2 -3
- package/lib/common/shorters/application.js +3 -3
- package/lib/common/shorters/bans.js +1 -1
- package/lib/common/shorters/channels.d.ts +3 -3
- package/lib/common/shorters/channels.js +3 -3
- package/lib/common/shorters/emojis.js +4 -4
- package/lib/common/shorters/guilds.d.ts +3 -3
- package/lib/common/shorters/guilds.js +5 -9
- package/lib/common/shorters/interaction.d.ts +3 -3
- package/lib/common/shorters/interaction.js +6 -5
- package/lib/common/shorters/members.d.ts +4 -5
- package/lib/common/shorters/members.js +6 -7
- package/lib/common/shorters/messages.d.ts +1 -1
- package/lib/common/shorters/messages.js +4 -4
- package/lib/common/shorters/reactions.d.ts +1 -1
- package/lib/common/shorters/reactions.js +1 -1
- package/lib/common/shorters/roles.js +1 -1
- package/lib/common/shorters/templates.js +2 -2
- package/lib/common/shorters/threads.d.ts +1 -1
- package/lib/common/shorters/threads.js +17 -11
- package/lib/common/shorters/webhook.d.ts +1 -1
- package/lib/common/shorters/webhook.js +4 -4
- package/lib/common/types/options.d.ts +2 -2
- package/lib/common/types/resolvables.d.ts +1 -1
- package/lib/common/types/util.d.ts +4 -1
- package/lib/common/types/write.d.ts +1 -1
- package/lib/components/BaseComponent.js +1 -1
- package/lib/components/ButtonComponent.d.ts +1 -1
- package/lib/components/componentcommand.d.ts +1 -1
- package/lib/components/componentcontext.d.ts +4 -4
- package/lib/components/componentcontext.js +1 -1
- package/lib/components/handler.d.ts +10 -8
- package/lib/components/handler.js +16 -13
- package/lib/components/index.js +2 -1
- package/lib/components/modalcontext.d.ts +2 -2
- package/lib/components/modalcontext.js +1 -1
- package/lib/deps/mixer.d.ts +1 -1
- package/lib/events/handler.d.ts +5 -5
- package/lib/events/handler.js +66 -16
- package/lib/events/hooks/application_command.d.ts +1 -1
- package/lib/events/hooks/auto_moderation.d.ts +1 -1
- package/lib/events/hooks/auto_moderation.js +1 -1
- package/lib/events/hooks/channel.d.ts +1 -1
- package/lib/events/hooks/dispatch.d.ts +1 -1
- package/lib/events/hooks/entitlement.d.ts +4 -5
- package/lib/events/hooks/entitlement.js +4 -4
- package/lib/events/hooks/guild.d.ts +3 -3
- package/lib/events/hooks/guild.js +1 -1
- package/lib/events/hooks/index.d.ts +1 -0
- package/lib/events/hooks/index.js +1 -0
- package/lib/events/hooks/integration.d.ts +1 -1
- package/lib/events/hooks/integration.js +1 -1
- package/lib/events/hooks/interactions.d.ts +3 -3
- package/lib/events/hooks/invite.d.ts +1 -1
- package/lib/events/hooks/message.d.ts +3 -3
- package/lib/events/hooks/message.js +1 -1
- package/lib/events/hooks/presence.d.ts +2 -2
- package/lib/events/hooks/soundboard.d.ts +155 -0
- package/lib/events/hooks/soundboard.js +28 -0
- package/lib/events/hooks/stage.d.ts +2 -2
- package/lib/events/hooks/thread.d.ts +2 -2
- package/lib/events/hooks/thread.js +2 -2
- package/lib/events/hooks/typing.d.ts +1 -1
- package/lib/events/hooks/typing.js +1 -1
- package/lib/events/hooks/user.d.ts +2 -2
- package/lib/events/hooks/voice.d.ts +2 -2
- package/lib/events/hooks/voice.js +1 -1
- package/lib/events/hooks/webhook.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -5
- package/lib/langs/handler.d.ts +2 -2
- package/lib/structures/Guild.d.ts +7 -4
- package/lib/structures/Guild.js +1 -1
- package/lib/structures/GuildBan.d.ts +1 -1
- package/lib/structures/GuildMember.d.ts +7 -5
- package/lib/structures/GuildMember.js +5 -3
- package/lib/structures/GuildRole.d.ts +1 -1
- package/lib/structures/GuildTemplate.d.ts +1 -1
- package/lib/structures/Interaction.d.ts +17 -14
- package/lib/structures/Interaction.js +28 -21
- package/lib/structures/Message.d.ts +4 -7
- package/lib/structures/Message.js +5 -5
- package/lib/structures/Poll.d.ts +3 -3
- package/lib/structures/Sticker.d.ts +2 -2
- package/lib/structures/Sticker.js +1 -1
- package/lib/structures/VoiceState.d.ts +2 -1
- package/lib/structures/VoiceState.js +1 -1
- package/lib/structures/Webhook.d.ts +3 -3
- package/lib/structures/Webhook.js +1 -1
- package/lib/structures/channels.d.ts +4 -4
- package/lib/structures/channels.js +6 -5
- package/lib/structures/extra/BitField.d.ts +3 -3
- package/lib/structures/extra/BitField.js +34 -33
- package/lib/structures/extra/DiscordBase.js +1 -1
- package/lib/structures/extra/Permissions.d.ts +2 -0
- package/lib/structures/extra/Permissions.js +21 -0
- package/lib/types/gateway.d.ts +53 -5
- package/lib/types/payloads/_interactions/base.d.ts +1 -1
- package/lib/types/payloads/channel.d.ts +2 -2
- package/lib/types/payloads/guild.d.ts +9 -1
- package/lib/types/payloads/guild.js +8 -0
- package/lib/types/payloads/index.d.ts +1 -0
- package/lib/types/payloads/index.js +1 -0
- package/lib/types/payloads/soundboard.d.ts +23 -0
- package/lib/types/payloads/soundboard.js +5 -0
- package/lib/types/payloads/user.js +0 -1
- package/lib/types/rest/application.d.ts +3 -3
- package/lib/types/rest/auditLog.d.ts +1 -1
- package/lib/types/rest/channel.d.ts +2 -2
- package/lib/types/rest/guild.d.ts +2 -2
- package/lib/types/rest/guildScheduledEvent.d.ts +1 -1
- package/lib/types/rest/index.d.ts +1 -0
- package/lib/types/rest/index.js +1 -0
- package/lib/types/rest/oauth2.d.ts +1 -1
- package/lib/types/rest/poll.d.ts +1 -1
- package/lib/types/rest/soundboard.d.ts +64 -0
- package/lib/types/rest/soundboard.js +2 -0
- package/lib/types/rest/stageInstance.d.ts +1 -1
- package/lib/types/rest/template.d.ts +1 -1
- package/lib/types/rest/user.d.ts +1 -1
- package/lib/types/rest/webhook.d.ts +1 -1
- package/lib/types/utils/index.d.ts +11 -2
- package/lib/types/utils/index.js +10 -2
- package/lib/websocket/SharedTypes.d.ts +11 -2
- package/lib/websocket/constants/index.js +0 -10
- package/lib/websocket/discord/basesocket.d.ts +1 -1
- package/lib/websocket/discord/shard.d.ts +1 -1
- package/lib/websocket/discord/shard.js +25 -16
- package/lib/websocket/discord/sharder.d.ts +9 -6
- package/lib/websocket/discord/sharder.js +91 -74
- package/lib/websocket/discord/shared.d.ts +3 -14
- package/lib/websocket/discord/socket/custom.js +19 -6
- package/lib/websocket/discord/worker.d.ts +8 -2
- package/lib/websocket/discord/workermanager.d.ts +42 -17
- package/lib/websocket/discord/workermanager.js +144 -37
- package/lib/websocket/structures/timeout.d.ts +4 -5
- package/lib/websocket/structures/timeout.js +23 -24
- package/package.json +72 -70
- package/lib/cache/resources/threads.d.ts +0 -14
- package/lib/cache/resources/threads.js +0 -32
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChannelShorter = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const structures_1 = require("../../structures");
|
|
5
6
|
const Permissions_1 = require("../../structures/extra/Permissions");
|
|
6
|
-
const base_1 = require("./base");
|
|
7
|
-
const utils_1 = require("../it/utils");
|
|
8
|
-
const transformers_1 = require("../../client/transformers");
|
|
9
7
|
const types_1 = require("../../types");
|
|
8
|
+
const utils_1 = require("../it/utils");
|
|
9
|
+
const base_1 = require("./base");
|
|
10
10
|
class ChannelShorter extends base_1.BaseShorter {
|
|
11
11
|
/**
|
|
12
12
|
* Fetches a channel by its ID.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EmojiShorter = void 0;
|
|
4
4
|
const builders_1 = require("../../builders");
|
|
5
|
-
const base_1 = require("./base");
|
|
6
5
|
const transformers_1 = require("../../client/transformers");
|
|
6
|
+
const base_1 = require("./base");
|
|
7
7
|
class EmojiShorter extends base_1.BaseShorter {
|
|
8
8
|
/**
|
|
9
9
|
* Retrieves a list of emojis in the guild.
|
|
@@ -34,7 +34,7 @@ class EmojiShorter extends base_1.BaseShorter {
|
|
|
34
34
|
const emoji = await this.client.proxy.guilds(guildId).emojis.post({
|
|
35
35
|
body: bodyResolved,
|
|
36
36
|
});
|
|
37
|
-
await this.client.cache.emojis?.setIfNI('
|
|
37
|
+
await this.client.cache.emojis?.setIfNI('GuildExpressions', emoji.id, guildId, emoji);
|
|
38
38
|
return transformers_1.Transformers.GuildEmoji(this.client, emoji, guildId);
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -62,7 +62,7 @@ class EmojiShorter extends base_1.BaseShorter {
|
|
|
62
62
|
*/
|
|
63
63
|
async delete(guildId, emojiId, reason) {
|
|
64
64
|
await this.client.proxy.guilds(guildId).emojis(emojiId).delete({ reason });
|
|
65
|
-
await this.client.cache.emojis?.removeIfNI('
|
|
65
|
+
await this.client.cache.emojis?.removeIfNI('GuildExpressions', emojiId, guildId);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Edits an emoji in the guild.
|
|
@@ -74,7 +74,7 @@ class EmojiShorter extends base_1.BaseShorter {
|
|
|
74
74
|
*/
|
|
75
75
|
async edit(guildId, emojiId, body, reason) {
|
|
76
76
|
const emoji = await this.client.proxy.guilds(guildId).emojis(emojiId).patch({ body, reason });
|
|
77
|
-
await this.client.cache.emojis?.setIfNI('
|
|
77
|
+
await this.client.cache.emojis?.setIfNI('GuildExpressions', emoji.id, guildId, emoji);
|
|
78
78
|
return transformers_1.Transformers.GuildEmoji(this.client, emoji, guildId);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { type GuildStructure } from '../../client/transformers';
|
|
2
|
+
import { BaseChannel, type CreateStickerBodyRequest, Guild, GuildMember } from '../../structures';
|
|
1
3
|
import type { GuildWidgetStyle, RESTGetAPICurrentUserGuildsQuery, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildStickerJSONBody, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildsJSONBody } from '../../types';
|
|
2
|
-
import { Guild, GuildMember, type CreateStickerBodyRequest } from '../../structures';
|
|
3
4
|
import { BaseShorter } from './base';
|
|
4
|
-
import { type GuildStructure } from '../../client/transformers';
|
|
5
5
|
export declare class GuildShorter extends BaseShorter {
|
|
6
6
|
/**
|
|
7
7
|
* Creates a new guild.
|
|
@@ -46,7 +46,7 @@ export declare class GuildShorter extends BaseShorter {
|
|
|
46
46
|
* @param force Whether to force fetching the channel from the API even if it exists in the cache.
|
|
47
47
|
* @returns A Promise that resolves to the fetched channel.
|
|
48
48
|
*/
|
|
49
|
-
fetch: (guildId: string, channelId: string, force?: boolean) => Promise<import("../../structures").
|
|
49
|
+
fetch: (guildId: string, channelId: string, force?: boolean) => Promise<import("../../types").APIGuildCategoryChannel | import("../../types").APIGuildStageVoiceChannel | import("../../types").APIGuildVoiceChannel | import("../../types").APINewsChannel | import("../../types").APITextChannel | BaseChannel<import("../../types").ChannelType> | import("../../structures").DMChannel | import("../../structures").CategoryChannel>;
|
|
50
50
|
/**
|
|
51
51
|
* Creates a new channel in the guild.
|
|
52
52
|
* @param guildId The ID of the guild.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GuildShorter = void 0;
|
|
4
4
|
const builders_1 = require("../../builders");
|
|
5
|
+
const transformers_1 = require("../../client/transformers");
|
|
5
6
|
const structures_1 = require("../../structures");
|
|
6
7
|
const base_1 = require("./base");
|
|
7
|
-
const transformers_1 = require("../../client/transformers");
|
|
8
8
|
class GuildShorter extends base_1.BaseShorter {
|
|
9
9
|
/**
|
|
10
10
|
* Creates a new guild.
|
|
@@ -42,11 +42,7 @@ class GuildShorter extends base_1.BaseShorter {
|
|
|
42
42
|
* @returns The generated widget URL.
|
|
43
43
|
*/
|
|
44
44
|
widgetURL(id, style) {
|
|
45
|
-
|
|
46
|
-
if (style) {
|
|
47
|
-
query.append('style', style);
|
|
48
|
-
}
|
|
49
|
-
return this.client.proxy.guilds(id).widget.get({ query });
|
|
45
|
+
return this.client.proxy.guilds(id).widget.get({ query: { style } });
|
|
50
46
|
}
|
|
51
47
|
async edit(guildId, body, reason) {
|
|
52
48
|
const guild = await this.client.proxy.guilds(guildId).patch({ body, reason });
|
|
@@ -257,7 +253,7 @@ class GuildShorter extends base_1.BaseShorter {
|
|
|
257
253
|
const sticker = await this.client.proxy
|
|
258
254
|
.guilds(guildId)
|
|
259
255
|
.stickers.post({ reason, body: json, files: [{ ...fileResolve[0], key: 'file' }], appendToFormData: true });
|
|
260
|
-
await this.client.cache.stickers?.setIfNI('
|
|
256
|
+
await this.client.cache.stickers?.setIfNI('GuildExpressions', sticker.id, guildId, sticker);
|
|
261
257
|
return transformers_1.Transformers.Sticker(this.client, sticker);
|
|
262
258
|
},
|
|
263
259
|
/**
|
|
@@ -270,7 +266,7 @@ class GuildShorter extends base_1.BaseShorter {
|
|
|
270
266
|
*/
|
|
271
267
|
edit: async (guildId, stickerId, body, reason) => {
|
|
272
268
|
const sticker = await this.client.proxy.guilds(guildId).stickers(stickerId).patch({ body, reason });
|
|
273
|
-
await this.client.cache.stickers?.setIfNI('
|
|
269
|
+
await this.client.cache.stickers?.setIfNI('GuildExpressions', stickerId, guildId, sticker);
|
|
274
270
|
return transformers_1.Transformers.Sticker(this.client, sticker);
|
|
275
271
|
},
|
|
276
272
|
/**
|
|
@@ -300,7 +296,7 @@ class GuildShorter extends base_1.BaseShorter {
|
|
|
300
296
|
*/
|
|
301
297
|
delete: async (guildId, stickerId, reason) => {
|
|
302
298
|
await this.client.proxy.guilds(guildId).stickers(stickerId).delete({ reason });
|
|
303
|
-
await this.client.cache.stickers?.removeIfNI('
|
|
299
|
+
await this.client.cache.stickers?.removeIfNI('GuildExpressions', stickerId, guildId);
|
|
304
300
|
},
|
|
305
301
|
};
|
|
306
302
|
}
|
|
@@ -2,12 +2,12 @@ import { type ReplyInteractionBody } from '../..';
|
|
|
2
2
|
import type { InteractionMessageUpdateBodyRequest, MessageWebhookCreateBodyRequest } from '../types/write';
|
|
3
3
|
import { BaseShorter } from './base';
|
|
4
4
|
export declare class InteractionShorter extends BaseShorter {
|
|
5
|
-
reply(id: string, token: string, body: ReplyInteractionBody): Promise<import("../../types").RESTPostAPIInteractionCallbackResult>;
|
|
5
|
+
reply(id: string, token: string, body: ReplyInteractionBody, withResponse?: boolean): Promise<import("../../types").RESTPostAPIInteractionCallbackResult | undefined>;
|
|
6
6
|
fetchResponse(token: string, messageId: string): Promise<import("../..").WebhookMessage | undefined>;
|
|
7
7
|
fetchOriginal(token: string): Promise<import("../..").WebhookMessage | undefined>;
|
|
8
8
|
editMessage(token: string, messageId: string, body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
|
|
9
9
|
editOriginal(token: string, body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
|
|
10
|
-
deleteResponse(
|
|
11
|
-
deleteOriginal(
|
|
10
|
+
deleteResponse(token: string, messageId: string): Promise<void | undefined>;
|
|
11
|
+
deleteOriginal(token: string): Promise<void | undefined>;
|
|
12
12
|
followup(token: string, { files, ...body }: MessageWebhookCreateBodyRequest): Promise<import("../..").WebhookMessage>;
|
|
13
13
|
}
|
|
@@ -5,7 +5,7 @@ const __1 = require("../..");
|
|
|
5
5
|
const transformers_1 = require("../../client/transformers");
|
|
6
6
|
const base_1 = require("./base");
|
|
7
7
|
class InteractionShorter extends base_1.BaseShorter {
|
|
8
|
-
async reply(id, token, body) {
|
|
8
|
+
async reply(id, token, body, withResponse = false) {
|
|
9
9
|
//@ts-expect-error
|
|
10
10
|
const { files, ...rest } = body.data ?? {};
|
|
11
11
|
//@ts-expect-error
|
|
@@ -19,6 +19,7 @@ class InteractionShorter extends base_1.BaseShorter {
|
|
|
19
19
|
data,
|
|
20
20
|
}, parsedFiles, this.client),
|
|
21
21
|
files: parsedFiles,
|
|
22
|
+
query: { with_response: withResponse },
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
fetchResponse(token, messageId) {
|
|
@@ -42,15 +43,15 @@ class InteractionShorter extends base_1.BaseShorter {
|
|
|
42
43
|
editOriginal(token, body) {
|
|
43
44
|
return this.editMessage(token, '@original', body);
|
|
44
45
|
}
|
|
45
|
-
deleteResponse(
|
|
46
|
+
deleteResponse(token, messageId) {
|
|
46
47
|
return this.client.proxy
|
|
47
48
|
.webhooks(this.client.applicationId)(token)
|
|
48
49
|
.messages(messageId)
|
|
49
50
|
.delete()
|
|
50
|
-
.then(() => this.client.components?.
|
|
51
|
+
.then(() => this.client.components?.deleteValue(messageId, 'messageDelete'));
|
|
51
52
|
}
|
|
52
|
-
deleteOriginal(
|
|
53
|
-
return this.deleteResponse(
|
|
53
|
+
deleteOriginal(token) {
|
|
54
|
+
return this.deleteResponse(token, '@original');
|
|
54
55
|
}
|
|
55
56
|
async followup(token, { files, ...body }) {
|
|
56
57
|
const parsedFiles = files ? await (0, __1.resolveFiles)(files) : undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type VoiceStateStructure } from '../../client/transformers';
|
|
2
2
|
import { PermissionsBitField } from '../../structures/extra/Permissions';
|
|
3
|
+
import { type APIGuildMember, type RESTGetAPIGuildMembersQuery, type RESTGetAPIGuildMembersSearchQuery, type RESTPatchAPIGuildMemberJSONBody, type RESTPutAPIGuildBanJSONBody, type RESTPutAPIGuildMemberJSONBody } from '../../types';
|
|
3
4
|
import type { GuildMemberResolvable } from '../types/resolvables';
|
|
4
5
|
import { BaseShorter } from './base';
|
|
5
|
-
import { type VoiceStateStructure } from '../../client/transformers';
|
|
6
6
|
export declare class MemberShorter extends BaseShorter {
|
|
7
7
|
/**
|
|
8
8
|
* Resolves a member in the guild based on the provided GuildMemberResolvable.
|
|
@@ -22,10 +22,9 @@ export declare class MemberShorter extends BaseShorter {
|
|
|
22
22
|
* Unbans a member from the guild.
|
|
23
23
|
* @param guildId The ID of the guild.
|
|
24
24
|
* @param memberId The ID of the member to unban.
|
|
25
|
-
* @param body The request body for unbanning the member.
|
|
26
25
|
* @param reason The reason for unbanning the member.
|
|
27
26
|
*/
|
|
28
|
-
unban(guildId: string, memberId: string,
|
|
27
|
+
unban(guildId: string, memberId: string, reason?: string): Promise<void>;
|
|
29
28
|
/**
|
|
30
29
|
* Bans a member from the guild.
|
|
31
30
|
* @param guildId The ID of the guild.
|
|
@@ -81,7 +80,7 @@ export declare class MemberShorter extends BaseShorter {
|
|
|
81
80
|
* @param memberId The ID of the member to add the role to.
|
|
82
81
|
* @param id The ID of the role to add.
|
|
83
82
|
*/
|
|
84
|
-
addRole(guildId: string, memberId: string, id: string):
|
|
83
|
+
addRole(guildId: string, memberId: string, id: string): Promise<never>;
|
|
85
84
|
/**
|
|
86
85
|
* Removes a role from a guild member.
|
|
87
86
|
* @param guildId The ID of the guild.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MemberShorter = void 0;
|
|
4
|
-
const
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
5
5
|
const Permissions_1 = require("../../structures/extra/Permissions");
|
|
6
|
+
const types_1 = require("../../types");
|
|
6
7
|
const base_1 = require("./base");
|
|
7
|
-
const transformers_1 = require("../../client/transformers");
|
|
8
8
|
class MemberShorter extends base_1.BaseShorter {
|
|
9
9
|
/**
|
|
10
10
|
* Resolves a member in the guild based on the provided GuildMemberResolvable.
|
|
@@ -27,7 +27,7 @@ class MemberShorter extends base_1.BaseShorter {
|
|
|
27
27
|
if (id) {
|
|
28
28
|
return this.client.members.fetch(guildId, id);
|
|
29
29
|
}
|
|
30
|
-
const displayName = 'displayName' in resolve ? resolve.displayName : resolve.nick ?? resolve.user?.username;
|
|
30
|
+
const displayName = 'displayName' in resolve ? resolve.displayName : (resolve.nick ?? resolve.user?.username);
|
|
31
31
|
return displayName ? this.search(guildId, { query: displayName, limit: 1 }).then(x => x[0]) : undefined;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -47,11 +47,10 @@ class MemberShorter extends base_1.BaseShorter {
|
|
|
47
47
|
* Unbans a member from the guild.
|
|
48
48
|
* @param guildId The ID of the guild.
|
|
49
49
|
* @param memberId The ID of the member to unban.
|
|
50
|
-
* @param body The request body for unbanning the member.
|
|
51
50
|
* @param reason The reason for unbanning the member.
|
|
52
51
|
*/
|
|
53
|
-
async unban(guildId, memberId,
|
|
54
|
-
await this.client.proxy.guilds(guildId).bans(memberId).delete({ reason
|
|
52
|
+
async unban(guildId, memberId, reason) {
|
|
53
|
+
await this.client.proxy.guilds(guildId).bans(memberId).delete({ reason });
|
|
55
54
|
}
|
|
56
55
|
/**
|
|
57
56
|
* Bans a member from the guild.
|
|
@@ -154,7 +153,7 @@ class MemberShorter extends base_1.BaseShorter {
|
|
|
154
153
|
* @param id The ID of the role to add.
|
|
155
154
|
*/
|
|
156
155
|
addRole(guildId, memberId, id) {
|
|
157
|
-
this.client.proxy.guilds(guildId).members(memberId).roles(id).put(
|
|
156
|
+
return this.client.proxy.guilds(guildId).members(memberId).roles(id).put();
|
|
158
157
|
}
|
|
159
158
|
/**
|
|
160
159
|
* Removes a role from a guild member.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RESTPostAPIChannelMessagesThreadsJSONBody } from '../../types';
|
|
2
|
+
import type { ValidAnswerId } from '../../api/Routes/channels';
|
|
2
3
|
import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../types/write';
|
|
3
4
|
import { BaseShorter } from './base';
|
|
4
|
-
import type { ValidAnswerId } from '../../api/Routes/channels';
|
|
5
5
|
export declare class MessageShorter extends BaseShorter {
|
|
6
6
|
write(channelId: string, { files, ...body }: MessageCreateBodyRequest): Promise<import("../../structures").Message>;
|
|
7
7
|
edit(messageId: string, channelId: string, { files, ...body }: MessageUpdateBodyRequest): Promise<import("../../structures").Message>;
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MessageShorter = void 0;
|
|
4
4
|
const builders_1 = require("../../builders");
|
|
5
5
|
const structures_1 = require("../../structures");
|
|
6
|
-
const base_1 = require("./base");
|
|
7
6
|
const transformers_1 = require("../../client/transformers");
|
|
7
|
+
const base_1 = require("./base");
|
|
8
8
|
class MessageShorter extends base_1.BaseShorter {
|
|
9
9
|
async write(channelId, { files, ...body }) {
|
|
10
|
-
const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) :
|
|
10
|
+
const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) : undefined;
|
|
11
11
|
const transformedBody = structures_1.MessagesMethods.transformMessageBody(body, parsedFiles, this.client);
|
|
12
12
|
return this.client.proxy
|
|
13
13
|
.channels(channelId)
|
|
@@ -21,7 +21,7 @@ class MessageShorter extends base_1.BaseShorter {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
async edit(messageId, channelId, { files, ...body }) {
|
|
24
|
-
const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) :
|
|
24
|
+
const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) : undefined;
|
|
25
25
|
return this.client.proxy
|
|
26
26
|
.channels(channelId)
|
|
27
27
|
.messages(messageId)
|
|
@@ -51,7 +51,7 @@ class MessageShorter extends base_1.BaseShorter {
|
|
|
51
51
|
.delete({ reason })
|
|
52
52
|
.then(async () => {
|
|
53
53
|
await this.client.cache.messages?.removeIfNI('GuildMessages', messageId, channelId);
|
|
54
|
-
this.client.components?.
|
|
54
|
+
this.client.components?.deleteValue(messageId, 'messageDelete');
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
fetch(messageId, channelId) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { type UserStructure } from '../../client/transformers';
|
|
1
2
|
import type { RESTGetAPIChannelMessageReactionUsersQuery } from '../../types';
|
|
2
3
|
import type { EmojiResolvable } from '../types/resolvables';
|
|
3
4
|
import { BaseShorter } from './base';
|
|
4
|
-
import { type UserStructure } from '../../client/transformers';
|
|
5
5
|
export declare class ReactionShorter extends BaseShorter {
|
|
6
6
|
add(messageId: string, channelId: string, emoji: EmojiResolvable): Promise<void>;
|
|
7
7
|
delete(messageId: string, channelId: string, emoji: EmojiResolvable, userId?: string): Promise<void>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ReactionShorter = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const utils_1 = require("../../common/it/utils");
|
|
5
6
|
const base_1 = require("./base");
|
|
6
|
-
const transformers_1 = require("../../client/transformers");
|
|
7
7
|
class ReactionShorter extends base_1.BaseShorter {
|
|
8
8
|
async add(messageId, channelId, emoji) {
|
|
9
9
|
const rawEmoji = await (0, utils_1.resolveEmoji)(emoji, this.client.cache);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RoleShorter = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
5
4
|
const transformers_1 = require("../../client/transformers");
|
|
5
|
+
const base_1 = require("./base");
|
|
6
6
|
class RoleShorter extends base_1.BaseShorter {
|
|
7
7
|
/**
|
|
8
8
|
* Creates a new role in the guild.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TemplateShorter = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
5
4
|
const transformers_1 = require("../../client/transformers");
|
|
5
|
+
const base_1 = require("./base");
|
|
6
6
|
class TemplateShorter extends base_1.BaseShorter {
|
|
7
7
|
fetch(code) {
|
|
8
8
|
return this.client.proxy.guilds
|
|
@@ -26,7 +26,7 @@ class TemplateShorter extends base_1.BaseShorter {
|
|
|
26
26
|
return this.client.proxy
|
|
27
27
|
.guilds(guildId)
|
|
28
28
|
.templates(code)
|
|
29
|
-
.put(
|
|
29
|
+
.put()
|
|
30
30
|
.then(template => transformers_1.Transformers.GuildTemplate(this.client, template));
|
|
31
31
|
}
|
|
32
32
|
edit(guildId, code, body) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIThreadMember, RESTGetAPIChannelThreadMembersQuery, RESTGetAPIChannelThreadsArchivedQuery, RESTPatchAPIChannelJSONBody, RESTPostAPIChannelMessagesThreadsJSONBody, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIGuildForumThreadsJSONBody } from '../../types';
|
|
2
|
-
import { BaseShorter } from './base';
|
|
3
2
|
import type { MakeRequired, When } from '../types/util';
|
|
3
|
+
import { BaseShorter } from './base';
|
|
4
4
|
export declare class ThreadShorter extends BaseShorter {
|
|
5
5
|
/**
|
|
6
6
|
* Creates a new thread in the channel (only guild based channels).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ThreadShorter = void 0;
|
|
4
|
-
const base_1 = require("./base");
|
|
5
4
|
const structures_1 = require("../../structures");
|
|
5
|
+
const base_1 = require("./base");
|
|
6
6
|
class ThreadShorter extends base_1.BaseShorter {
|
|
7
7
|
/**
|
|
8
8
|
* Creates a new thread in the channel (only guild based channels).
|
|
@@ -15,7 +15,10 @@ class ThreadShorter extends base_1.BaseShorter {
|
|
|
15
15
|
.channels(channelId)
|
|
16
16
|
.threads.post({ body, reason })
|
|
17
17
|
// When testing this, discord returns the thread object, but in discord api types it does not.
|
|
18
|
-
.then(thread =>
|
|
18
|
+
.then(async (thread) => {
|
|
19
|
+
await this.client.cache.channels?.setIfNI('Guilds', thread.id, thread.guild_id, thread);
|
|
20
|
+
return (0, structures_1.channelFrom)(thread, this.client);
|
|
21
|
+
}));
|
|
19
22
|
}
|
|
20
23
|
async fromMessage(channelId, messageId, options) {
|
|
21
24
|
const { reason, ...body } = options;
|
|
@@ -23,34 +26,37 @@ class ThreadShorter extends base_1.BaseShorter {
|
|
|
23
26
|
.channels(channelId)
|
|
24
27
|
.messages(messageId)
|
|
25
28
|
.threads.post({ body, reason })
|
|
26
|
-
.then(thread =>
|
|
29
|
+
.then(async (thread) => {
|
|
30
|
+
await this.client.cache.channels?.setIfNI('Guilds', thread.id, thread.guild_id, thread);
|
|
31
|
+
return (0, structures_1.channelFrom)(thread, this.client);
|
|
32
|
+
});
|
|
27
33
|
}
|
|
28
|
-
|
|
34
|
+
join(threadId) {
|
|
29
35
|
return this.client.proxy.channels(threadId)['thread-members']('@me').put();
|
|
30
36
|
}
|
|
31
|
-
|
|
37
|
+
leave(threadId) {
|
|
32
38
|
return this.client.proxy.channels(threadId)['thread-members']('@me').delete();
|
|
33
39
|
}
|
|
34
|
-
|
|
40
|
+
lock(threadId, locked = true, reason) {
|
|
35
41
|
return this.edit(threadId, { locked }, reason).then(x => (0, structures_1.channelFrom)(x, this.client));
|
|
36
42
|
}
|
|
37
|
-
|
|
43
|
+
edit(threadId, body, reason) {
|
|
38
44
|
return this.client.channels.edit(threadId, body, { reason });
|
|
39
45
|
}
|
|
40
|
-
|
|
46
|
+
removeMember(threadId, memberId) {
|
|
41
47
|
return this.client.proxy.channels(threadId)['thread-members'](memberId).delete();
|
|
42
48
|
}
|
|
43
|
-
|
|
49
|
+
fetchMember(threadId, memberId, with_member) {
|
|
44
50
|
return this.client.proxy.channels(threadId)['thread-members'](memberId).get({
|
|
45
51
|
query: {
|
|
46
52
|
with_member,
|
|
47
53
|
},
|
|
48
54
|
});
|
|
49
55
|
}
|
|
50
|
-
|
|
56
|
+
addMember(threadId, memberId) {
|
|
51
57
|
return this.client.proxy.channels(threadId)['thread-members'](memberId).put();
|
|
52
58
|
}
|
|
53
|
-
|
|
59
|
+
listMembers(threadId, query) {
|
|
54
60
|
return this.client.proxy.channels(threadId)['thread-members'].get({ query });
|
|
55
61
|
}
|
|
56
62
|
async listArchivedThreads(channelId, type, query) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIChannelWebhookJSONBody } from '../../types';
|
|
2
1
|
import { type MessageWebhookMethodEditParams, type MessageWebhookMethodWriteParams } from '../../structures';
|
|
2
|
+
import type { RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIChannelWebhookJSONBody } from '../../types';
|
|
3
3
|
import { BaseShorter } from './base';
|
|
4
4
|
export declare class WebhookShorter extends BaseShorter {
|
|
5
5
|
create(channelId: string, body: RESTPostAPIChannelWebhookJSONBody): Promise<import("../../structures").Webhook>;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebhookShorter = void 0;
|
|
4
4
|
const builders_1 = require("../../builders");
|
|
5
|
+
const transformers_1 = require("../../client/transformers");
|
|
5
6
|
const structures_1 = require("../../structures");
|
|
6
7
|
const base_1 = require("./base");
|
|
7
|
-
const transformers_1 = require("../../client/transformers");
|
|
8
8
|
class WebhookShorter extends base_1.BaseShorter {
|
|
9
9
|
async create(channelId, body) {
|
|
10
10
|
const webhook = await this.client.proxy.channels(channelId).webhooks.post({
|
|
@@ -68,7 +68,7 @@ class WebhookShorter extends base_1.BaseShorter {
|
|
|
68
68
|
*/
|
|
69
69
|
async writeMessage(webhookId, token, { body: data, ...payload }) {
|
|
70
70
|
const { files, ...body } = data;
|
|
71
|
-
const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) :
|
|
71
|
+
const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) : undefined;
|
|
72
72
|
const transformedBody = structures_1.MessagesMethods.transformMessageBody(body, parsedFiles, this.client);
|
|
73
73
|
return this.client.proxy
|
|
74
74
|
.webhooks(webhookId)(token)
|
|
@@ -85,7 +85,7 @@ class WebhookShorter extends base_1.BaseShorter {
|
|
|
85
85
|
*/
|
|
86
86
|
async editMessage(webhookId, token, { messageId, body: data, ...json }) {
|
|
87
87
|
const { files, ...body } = data;
|
|
88
|
-
const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) :
|
|
88
|
+
const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) : undefined;
|
|
89
89
|
const transformedBody = structures_1.MessagesMethods.transformMessageBody(body, parsedFiles, this.client);
|
|
90
90
|
return this.client.proxy
|
|
91
91
|
.webhooks(webhookId)(token)
|
|
@@ -116,7 +116,7 @@ class WebhookShorter extends base_1.BaseShorter {
|
|
|
116
116
|
const message = await this.client.proxy
|
|
117
117
|
.webhooks(webhookId)(token)
|
|
118
118
|
.messages(messageId)
|
|
119
|
-
.get({ auth: false, query: { threadId } });
|
|
119
|
+
.get({ auth: false, query: threadId ? { thread_id: threadId } : undefined });
|
|
120
120
|
return message ? transformers_1.Transformers.WebhookMessage(this.client, message, webhookId, token) : undefined;
|
|
121
121
|
}
|
|
122
122
|
async listFromGuild(guildId) {
|
|
@@ -2,9 +2,9 @@ import type { Identify } from '..';
|
|
|
2
2
|
import type { CDNUrlOptions } from '../../api';
|
|
3
3
|
import type { UsingClient } from '../../commands';
|
|
4
4
|
export type ImageOptions = CDNUrlOptions;
|
|
5
|
-
export type MethodContext<T =
|
|
5
|
+
export type MethodContext<T = object> = Identify<{
|
|
6
6
|
client: UsingClient;
|
|
7
7
|
} & T>;
|
|
8
|
-
export type MessageWebhookPayload<Body, Extra =
|
|
8
|
+
export type MessageWebhookPayload<Body, Extra = object> = Identify<{
|
|
9
9
|
body: Body;
|
|
10
10
|
} & Extra>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APIGuildMember, APIPartialEmoji } from '../../types';
|
|
2
1
|
import type { EmbedColors } from '..';
|
|
3
2
|
import type { Attachment, AttachmentDataType, AttachmentResolvable } from '../../builders';
|
|
4
3
|
import type { GuildMember } from '../../structures';
|
|
4
|
+
import type { APIGuildMember, APIPartialEmoji } from '../../types';
|
|
5
5
|
export type EmojiResolvable = string | Partial<APIPartialEmoji> | `<${string | undefined}:${string}:${string}>`;
|
|
6
6
|
export type GuildMemberResolvable = string | Partial<GuildMember> | APIGuildMember;
|
|
7
7
|
export type ColorResolvable = `#${string}` | number | keyof typeof EmbedColors | 'Random' | [number, number, number];
|
|
@@ -6,8 +6,11 @@ export type StringToNumber<T extends string> = T extends `${infer N extends numb
|
|
|
6
6
|
export type MakePartial<T, K extends keyof T> = Omit<T, K> & {
|
|
7
7
|
[P in K]?: T[P];
|
|
8
8
|
};
|
|
9
|
+
export type MakeDeepPartial<T, K extends keyof T> = Omit<T, K> & {
|
|
10
|
+
[P in K]?: DeepPartial<T[P]>;
|
|
11
|
+
};
|
|
9
12
|
export type DeepPartial<T> = {
|
|
10
|
-
[K in keyof T]?: T[K] extends Record<any, any> ? DeepPartial<T[K]> : T[K] extends (infer I)[] ? DeepPartial<I>[] : Partial<T[K]>;
|
|
13
|
+
[K in keyof T]?: T[K] extends (...args: any[]) => any ? T[K] : T[K] extends Record<any, any> ? DeepPartial<T[K]> : T[K] extends (infer I)[] ? DeepPartial<I>[] : Partial<T[K]>;
|
|
11
14
|
};
|
|
12
15
|
export type OmitInsert<T, K extends keyof T, I> = I extends [] ? Omit<T, K> & I[number] : Omit<T, K> & I;
|
|
13
16
|
export type IntentStrings = (keyof typeof GatewayIntentBits)[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { APIActionRowComponent, APIEmbed, APIInteractionResponseCallbackData, APIInteractionResponseChannelMessageWithSource, APIMessageActionRowComponent, APIModalInteractionResponse, RESTAPIPollCreate, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIWebhookWithTokenJSONBody } from '../../types';
|
|
2
1
|
import type { RawFile } from '../../api';
|
|
3
2
|
import type { ActionRow, Attachment, AttachmentBuilder, BuilderComponents, Embed, Modal, PollBuilder } from '../../builders';
|
|
3
|
+
import type { APIActionRowComponent, APIEmbed, APIInteractionResponseCallbackData, APIInteractionResponseChannelMessageWithSource, APIMessageActionRowComponent, APIModalInteractionResponse, RESTAPIPollCreate, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIWebhookWithTokenJSONBody } from '../../types';
|
|
4
4
|
import type { OmitInsert } from './util';
|
|
5
5
|
export interface ResolverProps {
|
|
6
6
|
embeds?: Embed[] | APIEmbed[] | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseComponent = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
4
|
const builders_1 = require("../builders");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
6
|
class BaseComponent {
|
|
7
7
|
data;
|
|
8
8
|
constructor(data) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { APIButtonComponentWithCustomId, APIButtonComponentWithSKUId, APIButtonComponentWithURL, ButtonStyle, ComponentType } from '../types';
|
|
2
1
|
import { Button } from '../builders';
|
|
2
|
+
import type { APIButtonComponentWithCustomId, APIButtonComponentWithSKUId, APIButtonComponentWithURL, ButtonStyle, ComponentType } from '../types';
|
|
3
3
|
import { BaseComponent } from './BaseComponent';
|
|
4
4
|
export declare class LinkButtonComponent extends BaseComponent<ComponentType.Button> {
|
|
5
5
|
data: APIButtonComponentWithURL;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ContextComponentCommandInteractionMap, ComponentContext } from './componentcontext';
|
|
2
1
|
import type { ExtraProps, RegisteredMiddlewares, UsingClient } from '../commands';
|
|
2
|
+
import type { ComponentContext, ContextComponentCommandInteractionMap } from './componentcontext';
|
|
3
3
|
export declare const InteractionCommandType: {
|
|
4
4
|
readonly COMPONENT: 0;
|
|
5
5
|
readonly MODAL: 1;
|
|
@@ -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
3
|
import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands';
|
|
3
4
|
import { BaseContext } from '../commands/basecontext';
|
|
4
5
|
import type { ComponentInteractionMessageUpdate, InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, ModalCreateBodyRequest, UnionToTuple, When } from '../common';
|
|
5
|
-
import type { GuildMemberStructure, GuildStructure, MessageStructure, WebhookMessageStructure } from '../client/transformers';
|
|
6
6
|
export interface ComponentContext<Type extends keyof ContextComponentCommandInteractionMap = keyof ContextComponentCommandInteractionMap> extends BaseContext, ExtendContext {
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -41,7 +41,7 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
|
|
|
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<
|
|
44
|
+
deferReply(ephemeral?: boolean): Promise<undefined>;
|
|
45
45
|
/**
|
|
46
46
|
* Edits the response of the interaction.
|
|
47
47
|
* @param body - The updated body of the response.
|
|
@@ -51,7 +51,7 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
|
|
|
51
51
|
* Updates the interaction with new data.
|
|
52
52
|
* @param body - The updated body of the interaction.
|
|
53
53
|
*/
|
|
54
|
-
update(body: ComponentInteractionMessageUpdate): Promise<
|
|
54
|
+
update(body: ComponentInteractionMessageUpdate): Promise<undefined>;
|
|
55
55
|
/**
|
|
56
56
|
* Edits the response or replies to the interaction.
|
|
57
57
|
* @param body - The body of the response or updated body of the interaction.
|
|
@@ -63,7 +63,7 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
|
|
|
63
63
|
* @returns A promise that resolves when the response is deleted.
|
|
64
64
|
*/
|
|
65
65
|
deleteResponse(): Promise<void | undefined>;
|
|
66
|
-
modal(body: ModalCreateBodyRequest): Promise<
|
|
66
|
+
modal(body: ModalCreateBodyRequest): Promise<undefined>;
|
|
67
67
|
/**
|
|
68
68
|
* Gets the channel of the interaction.
|
|
69
69
|
* @param mode - The mode to fetch the channel.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ComponentContext = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
4
|
const basecontext_1 = require("../commands/basecontext");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
6
|
/**
|
|
7
7
|
* Represents a context for interacting with components in a Discord bot.
|
|
8
8
|
* @template Type - The type of component interaction.
|