seyfert 2.0.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 +9 -3
- package/lib/api/Routes/invites.d.ts +3 -4
- package/lib/api/Routes/skus.d.ts +10 -0
- package/lib/api/Routes/skus.js +2 -0
- 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 +26 -22
- package/lib/api/shared.d.ts +2 -2
- package/lib/api/utils/constants.d.ts +3 -1
- package/lib/api/utils/constants.js +3 -2
- package/lib/builders/ActionRow.d.ts +1 -1
- package/lib/builders/Attachment.d.ts +3 -3
- package/lib/builders/Attachment.js +13 -13
- 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 +12 -12
- package/lib/cache/index.js +48 -39
- 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 +10 -15
- package/lib/client/base.js +48 -44
- package/lib/client/client.d.ts +4 -4
- package/lib/client/client.js +37 -38
- package/lib/client/collectors.js +1 -1
- package/lib/client/httpclient.d.ts +1 -1
- package/lib/client/httpclient.js +2 -2
- package/lib/client/transformers.d.ts +37 -34
- package/lib/client/transformers.js +66 -63
- package/lib/client/workerclient.d.ts +13 -13
- package/lib/client/workerclient.js +182 -65
- 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 +46 -0
- package/lib/commands/applications/entryPoint.js +56 -0
- package/lib/commands/applications/entrycontext.d.ts +40 -0
- package/lib/commands/applications/entrycontext.js +85 -0
- 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 +7 -6
- package/lib/commands/applications/shared.d.ts +5 -2
- package/lib/commands/basecontext.d.ts +1 -1
- package/lib/commands/decorators.d.ts +20 -26
- package/lib/commands/decorators.js +8 -4
- package/lib/commands/handle.d.ts +13 -12
- package/lib/commands/handle.js +133 -65
- package/lib/commands/handler.d.ts +9 -7
- package/lib/commands/handler.js +27 -18
- package/lib/commands/index.d.ts +2 -0
- package/lib/commands/index.js +2 -0
- package/lib/commands/optionresolver.d.ts +4 -4
- package/lib/commands/optionresolver.js +4 -4
- package/lib/common/bot/watcher.d.ts +1 -1
- 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 +14 -6
- package/lib/common/it/utils.js +62 -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 +3 -3
- 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/deps/mixer.js +6 -1
- package/lib/events/handler.d.ts +5 -5
- package/lib/events/handler.js +69 -19
- 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/custom.d.ts +1 -0
- package/lib/events/hooks/custom.js +5 -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/subscriptions.d.ts +35 -0
- package/lib/events/hooks/subscriptions.js +16 -0
- 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 +39 -16
- package/lib/structures/Interaction.js +82 -26
- package/lib/structures/Message.d.ts +4 -10
- package/lib/structures/Message.js +5 -8
- 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 +8 -7
- package/lib/structures/extra/BaseGuild.d.ts +11 -1
- package/lib/structures/extra/BaseGuild.js +27 -0
- 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 +71 -6
- package/lib/types/payloads/_interactions/_applicationCommands/chatInput.d.ts +6 -1
- package/lib/types/payloads/_interactions/applicationCommands.d.ts +41 -6
- package/lib/types/payloads/_interactions/applicationCommands.js +28 -1
- package/lib/types/payloads/_interactions/base.d.ts +1 -1
- package/lib/types/payloads/_interactions/responses.d.ts +74 -2
- package/lib/types/payloads/_interactions/responses.js +4 -0
- package/lib/types/payloads/channel.d.ts +46 -6
- package/lib/types/payloads/channel.js +5 -1
- 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/monetization.d.ts +29 -1
- package/lib/types/payloads/monetization.js +10 -1
- 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 +5 -18
- 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/interactions.d.ts +30 -8
- package/lib/types/rest/monetization.d.ts +22 -1
- 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 +3 -3
- package/lib/types/utils/index.d.ts +27 -7
- package/lib/types/utils/index.js +25 -6
- package/lib/websocket/SharedTypes.d.ts +18 -3
- package/lib/websocket/constants/index.d.ts +3 -2
- package/lib/websocket/constants/index.js +4 -4
- package/lib/websocket/discord/basesocket.d.ts +1 -1
- package/lib/websocket/discord/shard.d.ts +4 -3
- package/lib/websocket/discord/shard.js +47 -24
- package/lib/websocket/discord/sharder.d.ts +9 -6
- package/lib/websocket/discord/sharder.js +92 -17
- package/lib/websocket/discord/shared.d.ts +12 -3
- package/lib/websocket/discord/socket/custom.d.ts +1 -1
- package/lib/websocket/discord/socket/custom.js +70 -40
- package/lib/websocket/discord/worker.d.ts +9 -2
- package/lib/websocket/discord/workermanager.d.ts +42 -16
- package/lib/websocket/discord/workermanager.js +170 -46
- package/lib/websocket/structures/timeout.d.ts +4 -5
- package/lib/websocket/structures/timeout.js +23 -24
- package/package.json +72 -65
- package/lib/cache/resources/threads.d.ts +0 -14
- package/lib/cache/resources/threads.js +0 -32
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { type APIApplicationCommandAutocompleteInteraction, type APIApplicationCommandInteraction, type APIBaseInteraction, type APIChatInputApplicationCommandInteraction, type APIChatInputApplicationCommandInteractionData, type APICommandAutocompleteInteractionResponseCallbackData, type APIInteraction, type APIInteractionResponse, type APIInteractionResponseChannelMessageWithSource, type APIInteractionResponseDeferredChannelMessageWithSource, type APIInteractionResponseDeferredMessageUpdate, type APIInteractionResponsePong, type APIInteractionResponseUpdateMessage, type APIMessageApplicationCommandInteraction, type APIMessageApplicationCommandInteractionData, type APIMessageButtonInteractionData, type APIMessageComponentInteraction, type APIMessageComponentSelectMenuInteraction, type APIMessageStringSelectInteractionData, type APIModalSubmission, type APIModalSubmitInteraction, type APIUserApplicationCommandInteraction, type APIUserApplicationCommandInteractionData, ApplicationCommandType, ComponentType, type GatewayInteractionCreateDispatchData, InteractionResponseType, InteractionType, type MessageFlags, type RESTPostAPIInteractionCallbackJSONBody } from '../types';
|
|
1
|
+
import { type APIApplicationCommandAutocompleteInteraction, type APIApplicationCommandInteraction, type APIBaseInteraction, type APIChatInputApplicationCommandInteraction, type APIChatInputApplicationCommandInteractionData, type APICommandAutocompleteInteractionResponseCallbackData, type APIEntryPointCommandInteraction, type APIInteraction, type APIInteractionResponse, type APIInteractionResponseChannelMessageWithSource, type APIInteractionResponseDeferredChannelMessageWithSource, type APIInteractionResponseDeferredMessageUpdate, type APIInteractionResponsePong, type APIInteractionResponseUpdateMessage, type APIMessageApplicationCommandInteraction, type APIMessageApplicationCommandInteractionData, type APIMessageButtonInteractionData, type APIMessageComponentInteraction, type APIMessageComponentSelectMenuInteraction, type APIMessageStringSelectInteractionData, type APIModalSubmission, type APIModalSubmitInteraction, type APIUserApplicationCommandInteraction, type APIUserApplicationCommandInteractionData, ApplicationCommandType, ComponentType, type GatewayInteractionCreateDispatchData, type InteractionCallbackData, type InteractionCallbackResourceActivity, InteractionResponseType, InteractionType, type MessageFlags, type RESTPostAPIInteractionCallbackJSONBody, type RESTPostAPIInteractionCallbackResult } from '../types';
|
|
2
2
|
import type { RawFile } from '../api';
|
|
3
|
+
import { type EntitlementStructure, type GuildRoleStructure, type InteractionGuildMemberStructure, type MessageStructure, type OptionResolverStructure, type UserStructure, type WebhookMessageStructure } from '../client/transformers';
|
|
3
4
|
import type { UsingClient } from '../commands';
|
|
4
|
-
import
|
|
5
|
+
import { type ComponentInteractionMessageUpdate, type InteractionCreateBodyRequest, type InteractionMessageUpdateBodyRequest, type MessageCreateBodyRequest, type MessageUpdateBodyRequest, type MessageWebhookCreateBodyRequest, type ModalCreateBodyRequest, type ObjectToLower, type OmitInsert, type ToClass, type When } from '../common';
|
|
5
6
|
import { type AllChannels } from './';
|
|
6
7
|
import { DiscordBase } from './extra/DiscordBase';
|
|
7
8
|
import { PermissionsBitField } from './extra/Permissions';
|
|
8
|
-
import { type GuildRoleStructure, type InteractionGuildMemberStructure, type MessageStructure, type UserStructure, type WebhookMessageStructure, type OptionResolverStructure } from '../client/transformers';
|
|
9
9
|
export type ReplyInteractionBody = {
|
|
10
10
|
type: InteractionResponseType.Modal;
|
|
11
11
|
data: ModalCreateBodyRequest;
|
|
12
12
|
} | {
|
|
13
13
|
type: InteractionResponseType.ChannelMessageWithSource | InteractionResponseType.UpdateMessage;
|
|
14
14
|
data: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest | ComponentInteractionMessageUpdate;
|
|
15
|
+
} | {
|
|
16
|
+
type: InteractionResponseType.LaunchActivity;
|
|
15
17
|
} | Exclude<RESTPostAPIInteractionCallbackJSONBody, APIInteractionResponsePong>;
|
|
16
18
|
export type __InternalReplyFunction = (_: {
|
|
17
19
|
body: APIInteractionResponse;
|
|
@@ -26,14 +28,15 @@ export declare class BaseInteraction<FromGuild extends boolean = boolean, Type e
|
|
|
26
28
|
member: When<FromGuild, InteractionGuildMemberStructure, undefined>;
|
|
27
29
|
channel?: AllChannels;
|
|
28
30
|
message?: MessageStructure;
|
|
29
|
-
replied?: Promise<boolean> | boolean;
|
|
31
|
+
replied?: Promise<boolean | RESTPostAPIInteractionCallbackResult | undefined> | boolean;
|
|
30
32
|
appPermissions?: PermissionsBitField;
|
|
33
|
+
entitlements: EntitlementStructure[];
|
|
31
34
|
constructor(client: UsingClient, interaction: Type, __reply?: __InternalReplyFunction | undefined);
|
|
32
35
|
static transformBodyRequest(body: ReplyInteractionBody, files: RawFile[] | undefined, self: UsingClient): APIInteractionResponse;
|
|
33
|
-
static transformBody<T>(body: InteractionMessageUpdateBodyRequest | MessageUpdateBodyRequest | MessageCreateBodyRequest | MessageWebhookCreateBodyRequest, files: RawFile[] | undefined, self: UsingClient): T;
|
|
36
|
+
static transformBody<T>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest | MessageUpdateBodyRequest | MessageCreateBodyRequest | MessageWebhookCreateBodyRequest, files: RawFile[] | undefined, self: UsingClient): T;
|
|
34
37
|
private matchReplied;
|
|
35
|
-
reply(body: ReplyInteractionBody): Promise<
|
|
36
|
-
deferReply(flags?: MessageFlags): Promise<
|
|
38
|
+
reply<WR extends boolean = false>(body: ReplyInteractionBody, withResponse?: WR): Promise<When<WR, WebhookMessageStructure, undefined>>;
|
|
39
|
+
deferReply<WR extends boolean = false>(flags?: MessageFlags, withResponse?: boolean): Promise<When<WR, WebhookMessageStructure, undefined>>;
|
|
37
40
|
isButton(): this is ButtonInteraction;
|
|
38
41
|
isChannelSelectMenu(): this is ChannelSelectMenuInteraction;
|
|
39
42
|
isRoleSelectMenu(): this is RoleSelectMenuInteraction;
|
|
@@ -45,10 +48,11 @@ export declare class BaseInteraction<FromGuild extends boolean = boolean, Type e
|
|
|
45
48
|
isMessage(): this is MessageCommandInteraction;
|
|
46
49
|
isAutocomplete(): this is AutocompleteInteraction;
|
|
47
50
|
isModal(): this is ModalSubmitInteraction;
|
|
48
|
-
|
|
51
|
+
isEntryPoint(): this is EntryPointInteraction;
|
|
52
|
+
static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): RoleSelectMenuInteraction | UserSelectMenuInteraction | MentionableSelectMenuInteraction | ChannelSelectMenuInteraction | StringSelectMenuInteraction<string[]> | ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ButtonInteraction | ModalSubmitInteraction<boolean> | AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../types").APIPingInteraction>;
|
|
49
53
|
fetchGuild(force?: boolean): Promise<import("./Guild").Guild<"api">> | undefined;
|
|
50
54
|
}
|
|
51
|
-
export type AllInteractions = AutocompleteInteraction | ChatInputCommandInteraction | UserCommandInteraction | MessageCommandInteraction | ComponentInteraction | SelectMenuInteraction | ModalSubmitInteraction | BaseInteraction;
|
|
55
|
+
export type AllInteractions = AutocompleteInteraction | ChatInputCommandInteraction | UserCommandInteraction | MessageCommandInteraction | ComponentInteraction | SelectMenuInteraction | ModalSubmitInteraction | EntryPointInteraction | BaseInteraction;
|
|
52
56
|
export interface AutocompleteInteraction extends ObjectToLower<Omit<APIApplicationCommandAutocompleteInteraction, 'user' | 'member' | 'type' | 'data' | 'message' | 'channel' | 'app_permissions'>> {
|
|
53
57
|
}
|
|
54
58
|
export declare class AutocompleteInteraction<FromGuild extends boolean = boolean> extends BaseInteraction<FromGuild, APIApplicationCommandAutocompleteInteraction> {
|
|
@@ -56,18 +60,19 @@ export declare class AutocompleteInteraction<FromGuild extends boolean = boolean
|
|
|
56
60
|
type: InteractionType.ApplicationCommandAutocomplete;
|
|
57
61
|
data: ObjectToLower<APIApplicationCommandAutocompleteInteraction['data']>;
|
|
58
62
|
options: OptionResolverStructure;
|
|
63
|
+
entitlements: EntitlementStructure[];
|
|
59
64
|
constructor(client: UsingClient, interaction: APIApplicationCommandAutocompleteInteraction, resolver?: OptionResolverStructure, __reply?: __InternalReplyFunction | undefined);
|
|
60
65
|
getInput(): string;
|
|
61
|
-
respond(choices: APICommandAutocompleteInteractionResponseCallbackData['choices']): Promise<
|
|
66
|
+
respond(choices: APICommandAutocompleteInteractionResponseCallbackData['choices']): Promise<undefined>;
|
|
62
67
|
isAutocomplete(): this is AutocompleteInteraction;
|
|
63
68
|
/** @intenal */
|
|
64
|
-
reply(..._args: unknown[]): Promise<
|
|
69
|
+
reply(..._args: unknown[]): Promise<any>;
|
|
65
70
|
}
|
|
66
71
|
export declare class Interaction<FromGuild extends boolean = boolean, Type extends APIInteraction = APIInteraction> extends BaseInteraction<FromGuild, Type> {
|
|
67
72
|
fetchMessage(messageId: string): Promise<import("./Message").WebhookMessage | undefined>;
|
|
68
73
|
fetchResponse(): Promise<import("./Message").WebhookMessage | undefined>;
|
|
69
|
-
write<FR extends boolean = false>(body: InteractionCreateBodyRequest,
|
|
70
|
-
modal(body: ModalCreateBodyRequest): Promise<
|
|
74
|
+
write<FR extends boolean = false>(body: InteractionCreateBodyRequest, withResponse?: FR): Promise<When<FR, WebhookMessageStructure, void>>;
|
|
75
|
+
modal(body: ModalCreateBodyRequest): Promise<undefined>;
|
|
71
76
|
editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<When<FR, WebhookMessageStructure, void>>;
|
|
72
77
|
editMessage(messageId: string, body: InteractionMessageUpdateBodyRequest): Promise<import("./Message").WebhookMessage>;
|
|
73
78
|
editResponse(body: InteractionMessageUpdateBodyRequest): Promise<import("./Message").WebhookMessage>;
|
|
@@ -77,7 +82,24 @@ export declare class Interaction<FromGuild extends boolean = boolean, Type exten
|
|
|
77
82
|
}
|
|
78
83
|
export declare class ApplicationCommandInteraction<FromGuild extends boolean = boolean, Type extends APIApplicationCommandInteraction = APIApplicationCommandInteraction> extends Interaction<FromGuild, Type> {
|
|
79
84
|
type: ApplicationCommandType;
|
|
80
|
-
respond(data: APIInteractionResponseChannelMessageWithSource | APIInteractionResponseDeferredChannelMessageWithSource | APIInteractionResponseDeferredMessageUpdate | APIInteractionResponseUpdateMessage): Promise<
|
|
85
|
+
respond(data: APIInteractionResponseChannelMessageWithSource | APIInteractionResponseDeferredChannelMessageWithSource | APIInteractionResponseDeferredMessageUpdate | APIInteractionResponseUpdateMessage): Promise<undefined>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Seyfert don't support activities, so this interaction is blank
|
|
89
|
+
*/
|
|
90
|
+
export declare class EntryPointInteraction<FromGuild extends boolean = boolean> extends ApplicationCommandInteraction<FromGuild, APIEntryPointCommandInteraction> {
|
|
91
|
+
withReponse(data?: InteractionCreateBodyRequest): Promise<EntryPointWithResponseResult>;
|
|
92
|
+
isEntryPoint(): this is EntryPointInteraction;
|
|
93
|
+
}
|
|
94
|
+
export interface EntryPointWithResponseResult {
|
|
95
|
+
interaction: ObjectToLower<InteractionCallbackData>;
|
|
96
|
+
resource?: {
|
|
97
|
+
type: InteractionResponseType.LaunchActivity;
|
|
98
|
+
activityInstance: InteractionCallbackResourceActivity;
|
|
99
|
+
} | {
|
|
100
|
+
type: Exclude<InteractionResponseType, InteractionResponseType.LaunchActivity>;
|
|
101
|
+
message: WebhookMessageStructure;
|
|
102
|
+
};
|
|
81
103
|
}
|
|
82
104
|
export interface ComponentInteraction extends ObjectToLower<Omit<APIMessageComponentInteraction, 'user' | 'member' | 'type' | 'data' | 'message' | 'channel' | 'app_permissions'>> {
|
|
83
105
|
}
|
|
@@ -87,8 +109,9 @@ export declare class ComponentInteraction<FromGuild extends boolean = boolean, T
|
|
|
87
109
|
channel: AllChannels;
|
|
88
110
|
type: InteractionType.MessageComponent;
|
|
89
111
|
message: MessageStructure;
|
|
90
|
-
|
|
91
|
-
|
|
112
|
+
entitlements: EntitlementStructure[];
|
|
113
|
+
update(data: ComponentInteractionMessageUpdate): Promise<undefined>;
|
|
114
|
+
deferUpdate(): Promise<undefined>;
|
|
92
115
|
get customId(): string;
|
|
93
116
|
get componentType(): ComponentType.Button | ComponentType.StringSelect | ComponentType.UserSelect | ComponentType.RoleSelect | ComponentType.MentionableSelect | ComponentType.ChannelSelect;
|
|
94
117
|
}
|
|
@@ -6,15 +6,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ModalSubmitInteraction = exports.MessageCommandInteraction = exports.UserCommandInteraction = exports.ChatInputCommandInteraction = exports.UserSelectMenuInteraction = exports.RoleSelectMenuInteraction = exports.MentionableSelectMenuInteraction = exports.ChannelSelectMenuInteraction = exports.StringSelectMenuInteraction = exports.SelectMenuInteraction = exports.ButtonInteraction = exports.ComponentInteraction = exports.ApplicationCommandInteraction = exports.Interaction = exports.AutocompleteInteraction = exports.BaseInteraction = void 0;
|
|
9
|
+
exports.ModalSubmitInteraction = exports.MessageCommandInteraction = exports.UserCommandInteraction = exports.ChatInputCommandInteraction = exports.UserSelectMenuInteraction = exports.RoleSelectMenuInteraction = exports.MentionableSelectMenuInteraction = exports.ChannelSelectMenuInteraction = exports.StringSelectMenuInteraction = exports.SelectMenuInteraction = exports.ButtonInteraction = exports.ComponentInteraction = exports.EntryPointInteraction = exports.ApplicationCommandInteraction = exports.Interaction = exports.AutocompleteInteraction = exports.BaseInteraction = void 0;
|
|
10
10
|
const types_1 = require("../types");
|
|
11
11
|
const builders_1 = require("../builders");
|
|
12
|
+
const transformers_1 = require("../client/transformers");
|
|
13
|
+
const common_1 = require("../common");
|
|
14
|
+
const mixer_1 = require("../deps/mixer");
|
|
12
15
|
const _1 = require("./");
|
|
13
16
|
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
14
17
|
const Permissions_1 = require("./extra/Permissions");
|
|
15
|
-
const transformers_1 = require("../client/transformers");
|
|
16
|
-
const mixer_1 = require("../deps/mixer");
|
|
17
|
-
const Entitlement_1 = require("./Entitlement");
|
|
18
18
|
class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
19
19
|
client;
|
|
20
20
|
__reply;
|
|
@@ -24,6 +24,7 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
|
24
24
|
message;
|
|
25
25
|
replied;
|
|
26
26
|
appPermissions;
|
|
27
|
+
entitlements;
|
|
27
28
|
constructor(client, interaction, __reply) {
|
|
28
29
|
super(client, interaction);
|
|
29
30
|
this.client = client;
|
|
@@ -41,7 +42,7 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
|
41
42
|
this.channel = (0, _1.channelFrom)(interaction.channel, client);
|
|
42
43
|
}
|
|
43
44
|
this.user = this.member?.user ?? transformers_1.Transformers.User(client, interaction.user);
|
|
44
|
-
this.entitlements = interaction.entitlements.map(e =>
|
|
45
|
+
this.entitlements = interaction.entitlements.map(e => transformers_1.Transformers.Entitlement(this.client, e));
|
|
45
46
|
}
|
|
46
47
|
static transformBodyRequest(body, files, self) {
|
|
47
48
|
switch (body.type) {
|
|
@@ -51,9 +52,9 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
|
51
52
|
return body;
|
|
52
53
|
case types_1.InteractionResponseType.ChannelMessageWithSource:
|
|
53
54
|
case types_1.InteractionResponseType.UpdateMessage: {
|
|
55
|
+
//@ts-ignore
|
|
54
56
|
return {
|
|
55
57
|
type: body.type,
|
|
56
|
-
//@ts-ignore
|
|
57
58
|
data: BaseInteraction.transformBody(body.data ?? {}, files, self),
|
|
58
59
|
};
|
|
59
60
|
}
|
|
@@ -71,6 +72,8 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
|
71
72
|
: [],
|
|
72
73
|
},
|
|
73
74
|
};
|
|
75
|
+
case types_1.InteractionResponseType.LaunchActivity:
|
|
76
|
+
return body;
|
|
74
77
|
default:
|
|
75
78
|
return body;
|
|
76
79
|
}
|
|
@@ -92,44 +95,54 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
|
92
95
|
})) ?? undefined;
|
|
93
96
|
}
|
|
94
97
|
else if (files?.length) {
|
|
95
|
-
payload.attachments = files?.map((
|
|
98
|
+
payload.attachments = files?.map(({ filename }, id) => ({
|
|
96
99
|
id,
|
|
97
|
-
filename
|
|
100
|
+
filename,
|
|
98
101
|
}));
|
|
99
102
|
}
|
|
100
103
|
return payload;
|
|
101
104
|
}
|
|
102
|
-
async matchReplied(body) {
|
|
105
|
+
async matchReplied(body, withResponse = false) {
|
|
103
106
|
if (this.__reply) {
|
|
104
107
|
//@ts-expect-error
|
|
105
108
|
const { files, ...rest } = body.data ?? {};
|
|
106
109
|
//@ts-expect-error
|
|
107
110
|
const data = body.data instanceof builders_1.Modal ? body.data : rest;
|
|
108
111
|
const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) : undefined;
|
|
109
|
-
|
|
112
|
+
await (this.replied = this.__reply({
|
|
110
113
|
body: BaseInteraction.transformBodyRequest({ data, type: body.type }, parsedFiles, this.client),
|
|
111
114
|
files: parsedFiles,
|
|
112
115
|
}).then(() => (this.replied = true)));
|
|
116
|
+
return;
|
|
113
117
|
}
|
|
114
|
-
|
|
118
|
+
const result = await (this.replied = this.client.interactions.reply(this.id, this.token, body, withResponse));
|
|
119
|
+
this.replied = true;
|
|
120
|
+
return result?.resource?.message
|
|
121
|
+
? transformers_1.Transformers.WebhookMessage(this.client, result.resource.message, this.id, this.token)
|
|
122
|
+
: undefined;
|
|
115
123
|
}
|
|
116
|
-
async reply(body) {
|
|
124
|
+
async reply(body, withResponse) {
|
|
117
125
|
if (this.replied) {
|
|
118
126
|
throw new Error('Interaction already replied');
|
|
119
127
|
}
|
|
120
|
-
await this.matchReplied(body);
|
|
128
|
+
const result = await this.matchReplied(body, withResponse);
|
|
121
129
|
// @ts-expect-error
|
|
122
|
-
if (body.data instanceof builders_1.Modal
|
|
130
|
+
if (body.data instanceof builders_1.Modal) {
|
|
123
131
|
// @ts-expect-error
|
|
124
|
-
|
|
132
|
+
if (body.data.__exec)
|
|
133
|
+
this.client.components.modals.set(this.user.id, body.data.__exec);
|
|
134
|
+
else if (this.client.components?.modals.has(this.user.id))
|
|
135
|
+
this.client.components.modals.delete(this.user.id);
|
|
136
|
+
}
|
|
137
|
+
return result;
|
|
125
138
|
}
|
|
126
|
-
deferReply(flags) {
|
|
139
|
+
deferReply(flags, withResponse = false) {
|
|
127
140
|
return this.reply({
|
|
128
141
|
type: types_1.InteractionResponseType.DeferredChannelMessageWithSource,
|
|
129
142
|
data: {
|
|
130
143
|
flags,
|
|
131
144
|
},
|
|
132
|
-
});
|
|
145
|
+
}, withResponse);
|
|
133
146
|
}
|
|
134
147
|
isButton() {
|
|
135
148
|
return false;
|
|
@@ -164,6 +177,9 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
|
164
177
|
isModal() {
|
|
165
178
|
return false;
|
|
166
179
|
}
|
|
180
|
+
isEntryPoint() {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
167
183
|
static from(client, gateway, __reply) {
|
|
168
184
|
switch (gateway.type) {
|
|
169
185
|
case types_1.InteractionType.ApplicationCommandAutocomplete:
|
|
@@ -177,6 +193,8 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
|
177
193
|
return new UserCommandInteraction(client, gateway, __reply);
|
|
178
194
|
case types_1.ApplicationCommandType.Message:
|
|
179
195
|
return new MessageCommandInteraction(client, gateway, __reply);
|
|
196
|
+
case types_1.ApplicationCommandType.PrimaryEntryPoint:
|
|
197
|
+
return new EntryPointInteraction(client, gateway, __reply);
|
|
180
198
|
}
|
|
181
199
|
// biome-ignore lint/suspicious/noFallthroughSwitchClause: bad interaction between biome and ts-server
|
|
182
200
|
case types_1.InteractionType.MessageComponent:
|
|
@@ -237,14 +255,11 @@ class Interaction extends BaseInteraction {
|
|
|
237
255
|
fetchResponse() {
|
|
238
256
|
return this.fetchMessage('@original');
|
|
239
257
|
}
|
|
240
|
-
async write(body,
|
|
241
|
-
|
|
258
|
+
async write(body, withResponse) {
|
|
259
|
+
return this.reply({
|
|
242
260
|
type: types_1.InteractionResponseType.ChannelMessageWithSource,
|
|
243
261
|
data: body,
|
|
244
|
-
})
|
|
245
|
-
if (fetchReply)
|
|
246
|
-
return this.fetchResponse();
|
|
247
|
-
return undefined;
|
|
262
|
+
}, withResponse);
|
|
248
263
|
}
|
|
249
264
|
modal(body) {
|
|
250
265
|
return this.reply({
|
|
@@ -254,8 +269,8 @@ class Interaction extends BaseInteraction {
|
|
|
254
269
|
}
|
|
255
270
|
async editOrReply(body, fetchReply) {
|
|
256
271
|
if (await this.replied) {
|
|
257
|
-
const { content, embeds, allowed_mentions, components, files, attachments } = body;
|
|
258
|
-
return this.editResponse({ content, embeds, allowed_mentions, components, files, attachments });
|
|
272
|
+
const { content, embeds, allowed_mentions, components, files, attachments, poll } = body;
|
|
273
|
+
return this.editResponse({ content, embeds, allowed_mentions, components, files, attachments, poll });
|
|
259
274
|
}
|
|
260
275
|
return this.write(body, fetchReply);
|
|
261
276
|
}
|
|
@@ -269,7 +284,7 @@ class Interaction extends BaseInteraction {
|
|
|
269
284
|
return this.deleteMessage('@original');
|
|
270
285
|
}
|
|
271
286
|
deleteMessage(messageId) {
|
|
272
|
-
return this.client.interactions.deleteResponse(this.
|
|
287
|
+
return this.client.interactions.deleteResponse(this.token, messageId);
|
|
273
288
|
}
|
|
274
289
|
followup(body) {
|
|
275
290
|
return this.client.interactions.followup(this.token, body);
|
|
@@ -283,6 +298,47 @@ class ApplicationCommandInteraction extends Interaction {
|
|
|
283
298
|
}
|
|
284
299
|
}
|
|
285
300
|
exports.ApplicationCommandInteraction = ApplicationCommandInteraction;
|
|
301
|
+
/**
|
|
302
|
+
* Seyfert don't support activities, so this interaction is blank
|
|
303
|
+
*/
|
|
304
|
+
class EntryPointInteraction extends ApplicationCommandInteraction {
|
|
305
|
+
async withReponse(data) {
|
|
306
|
+
let body = { type: types_1.InteractionResponseType.LaunchActivity };
|
|
307
|
+
if (data) {
|
|
308
|
+
let { files, ...rest } = data;
|
|
309
|
+
files = files ? await (0, builders_1.resolveFiles)(files) : undefined;
|
|
310
|
+
body = BaseInteraction.transformBody(rest, files, this.client);
|
|
311
|
+
}
|
|
312
|
+
const response = await this.client.proxy
|
|
313
|
+
.interactions(this.id)(this.token)
|
|
314
|
+
.callback.post({
|
|
315
|
+
body,
|
|
316
|
+
query: { with_response: true },
|
|
317
|
+
});
|
|
318
|
+
const result = {
|
|
319
|
+
interaction: (0, common_1.toCamelCase)(response.interaction),
|
|
320
|
+
};
|
|
321
|
+
if (response.resource) {
|
|
322
|
+
if (response.resource.type !== types_1.InteractionResponseType.LaunchActivity) {
|
|
323
|
+
result.resource = {
|
|
324
|
+
type: response.resource.type,
|
|
325
|
+
message: transformers_1.Transformers.WebhookMessage(this.client, response.resource.message, this.id, this.token),
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
result.resource = {
|
|
330
|
+
type: response.resource.type,
|
|
331
|
+
activityInstance: response.resource.activity_instance,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return result;
|
|
336
|
+
}
|
|
337
|
+
isEntryPoint() {
|
|
338
|
+
return true;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
exports.EntryPointInteraction = EntryPointInteraction;
|
|
286
342
|
class ComponentInteraction extends Interaction {
|
|
287
343
|
update(data) {
|
|
288
344
|
return this.reply({
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Embed } from '..';
|
|
2
2
|
import type { ListenerOptions } from '../builders';
|
|
3
|
+
import { type GuildMemberStructure, type PollStructure, type UserStructure } from '../client/transformers';
|
|
3
4
|
import type { UsingClient } from '../commands';
|
|
4
5
|
import { type ObjectToLower } from '../common';
|
|
5
6
|
import type { EmojiResolvable } from '../common/types/resolvables';
|
|
6
7
|
import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../common/types/write';
|
|
7
8
|
import type { ActionRowMessageComponents } from '../components';
|
|
8
9
|
import { MessageActionRowComponent } from '../components/ActionRow';
|
|
10
|
+
import type { APIChannelMention, APIEmbed, APIMessage, GatewayMessageCreateDispatchData } from '../types';
|
|
9
11
|
import type { MessageWebhookMethodEditParams, MessageWebhookMethodWriteParams } from './Webhook';
|
|
10
12
|
import { DiscordBase } from './extra/DiscordBase';
|
|
11
|
-
import { Embed } from '..';
|
|
12
|
-
import { type PollStructure, type GuildMemberStructure, type UserStructure } from '../client/transformers';
|
|
13
13
|
export type MessageData = APIMessage | GatewayMessageCreateDispatchData;
|
|
14
14
|
export interface BaseMessage extends DiscordBase, ObjectToLower<Omit<MessageData, 'timestamp' | 'author' | 'mentions' | 'components' | 'poll' | 'embeds'>> {
|
|
15
15
|
timestamp?: number;
|
|
@@ -28,10 +28,7 @@ export declare class BaseMessage extends DiscordBase {
|
|
|
28
28
|
embeds: InMessageEmbed[];
|
|
29
29
|
constructor(client: UsingClient, data: MessageData);
|
|
30
30
|
get user(): import("./User").User;
|
|
31
|
-
createComponentCollector(options?: ListenerOptions):
|
|
32
|
-
run<T extends import("../components/handler").CollectorInteraction = import("../components/handler").CollectorInteraction>(customId: string | string[] | RegExp, callback: import("..").ComponentCallback<T>): any;
|
|
33
|
-
stop(reason?: string): any;
|
|
34
|
-
};
|
|
31
|
+
createComponentCollector(options?: ListenerOptions): import("../components/handler").CreateComponentCollectorResult;
|
|
35
32
|
get url(): `https://discord.com/channels/${string}/${string}/${string}`;
|
|
36
33
|
guild(force?: boolean): Promise<import("./Guild").Guild<"api">> | undefined;
|
|
37
34
|
channel(force?: boolean): Promise<import("./channels").AllChannels>;
|
|
@@ -64,9 +61,6 @@ export declare class InMessageEmbed {
|
|
|
64
61
|
data: APIEmbed;
|
|
65
62
|
constructor(data: APIEmbed);
|
|
66
63
|
get title(): string | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* @deprecated
|
|
69
|
-
*/
|
|
70
64
|
get type(): import("../types").EmbedType | undefined;
|
|
71
65
|
get description(): string | undefined;
|
|
72
66
|
get url(): string | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InMessageEmbed = exports.WebhookMessage = exports.Message = exports.BaseMessage = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const transformers_1 = require("../client/transformers");
|
|
4
6
|
const common_1 = require("../common");
|
|
7
|
+
const common_2 = require("../common");
|
|
5
8
|
const ActionRow_1 = require("../components/ActionRow");
|
|
6
9
|
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
7
|
-
const common_2 = require("../common");
|
|
8
|
-
const __1 = require("..");
|
|
9
|
-
const transformers_1 = require("../client/transformers");
|
|
10
10
|
class BaseMessage extends DiscordBase_1.DiscordBase {
|
|
11
11
|
embeds;
|
|
12
12
|
constructor(client, data) {
|
|
@@ -24,7 +24,7 @@ class BaseMessage extends DiscordBase_1.DiscordBase {
|
|
|
24
24
|
return this.author;
|
|
25
25
|
}
|
|
26
26
|
createComponentCollector(options) {
|
|
27
|
-
return this.client.components.createComponentCollector(this.id, options);
|
|
27
|
+
return this.client.components.createComponentCollector(this.id, this.channelId, this.guildId, options);
|
|
28
28
|
}
|
|
29
29
|
get url() {
|
|
30
30
|
return common_2.Formatter.messageLink(this.guildId, this.channelId, this.id);
|
|
@@ -105,7 +105,7 @@ class WebhookMessage extends BaseMessage {
|
|
|
105
105
|
this.webhookToken = webhookToken;
|
|
106
106
|
}
|
|
107
107
|
fetch() {
|
|
108
|
-
return this.api.webhooks(this.webhookId)(this.webhookToken).get(
|
|
108
|
+
return this.api.webhooks(this.webhookId)(this.webhookToken).get();
|
|
109
109
|
}
|
|
110
110
|
edit(body) {
|
|
111
111
|
const { query, ...rest } = body;
|
|
@@ -135,9 +135,6 @@ class InMessageEmbed {
|
|
|
135
135
|
get title() {
|
|
136
136
|
return this.data.title;
|
|
137
137
|
}
|
|
138
|
-
/**
|
|
139
|
-
* @deprecated
|
|
140
|
-
*/
|
|
141
138
|
get type() {
|
|
142
139
|
return this.data.type;
|
|
143
140
|
}
|
package/lib/structures/Poll.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ValidAnswerId } from '../api/Routes/channels';
|
|
2
|
+
import type { UsingClient } from '../commands';
|
|
2
3
|
import { type ObjectToLower } from '../common';
|
|
4
|
+
import type { APIPoll } from '../types';
|
|
3
5
|
import { Base } from './extra/Base';
|
|
4
|
-
import type { UsingClient } from '../commands';
|
|
5
|
-
import type { ValidAnswerId } from '../api/Routes/channels';
|
|
6
6
|
export interface Poll extends ObjectToLower<APIPoll> {
|
|
7
7
|
}
|
|
8
8
|
export declare class Poll extends Base {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { APISticker, RESTPatchAPIGuildStickerJSONBody, RESTPostAPIGuildStickerFormDataBody } from '../types';
|
|
2
1
|
import type { RawFile, UsingClient } from '..';
|
|
3
2
|
import type { Attachment, AttachmentBuilder } from '../builders';
|
|
3
|
+
import { type UserStructure } from '../client/transformers';
|
|
4
4
|
import type { MethodContext, ObjectToLower } from '../common';
|
|
5
|
+
import type { APISticker, RESTPatchAPIGuildStickerJSONBody, RESTPostAPIGuildStickerFormDataBody } from '../types';
|
|
5
6
|
import { DiscordBase } from './extra/DiscordBase';
|
|
6
|
-
import { type UserStructure } from '../client/transformers';
|
|
7
7
|
export interface Sticker extends DiscordBase, ObjectToLower<Omit<APISticker, 'user'>> {
|
|
8
8
|
}
|
|
9
9
|
export declare class Sticker extends DiscordBase {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Sticker = void 0;
|
|
4
|
-
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
5
4
|
const transformers_1 = require("../client/transformers");
|
|
5
|
+
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
6
6
|
class Sticker extends DiscordBase_1.DiscordBase {
|
|
7
7
|
user;
|
|
8
8
|
constructor(client, data) {
|
|
@@ -3,6 +3,7 @@ import type { VoiceStateResource } from '../cache/resources/voice-states';
|
|
|
3
3
|
import { type GuildMemberStructure } from '../client/transformers';
|
|
4
4
|
import type { ObjectToLower } from '../common';
|
|
5
5
|
import type { APIVoiceState } from '../types';
|
|
6
|
+
import type { AllGuildVoiceChannels } from './channels';
|
|
6
7
|
import { Base } from './extra/Base';
|
|
7
8
|
export interface VoiceState extends Base, ObjectToLower<Omit<VoiceStateResource, 'member'>> {
|
|
8
9
|
}
|
|
@@ -12,7 +13,7 @@ export declare class VoiceState extends Base {
|
|
|
12
13
|
get isMuted(): boolean;
|
|
13
14
|
member(force?: boolean): Promise<import("./GuildMember").GuildMember>;
|
|
14
15
|
user(force?: boolean): Promise<import("./User").User>;
|
|
15
|
-
channel(force?: boolean): Promise<
|
|
16
|
+
channel(force?: boolean): Promise<AllGuildVoiceChannels> | undefined;
|
|
16
17
|
setMute(mute?: boolean, reason?: string): Promise<import("./GuildMember").GuildMember>;
|
|
17
18
|
setDeaf(deaf?: boolean, reason?: string): Promise<import("./GuildMember").GuildMember>;
|
|
18
19
|
setSuppress(suppress?: boolean): Promise<void>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { type AnonymousGuildStructure, type UserStructure } from '../client/transformers';
|
|
2
|
+
import type { UsingClient } from '../commands';
|
|
3
|
+
import type { ImageOptions, MessageWebhookCreateBodyRequest, MessageWebhookPayload, MessageWebhookUpdateBodyRequest, MethodContext, ObjectToLower } from '../common';
|
|
1
4
|
/**
|
|
2
5
|
* Represents a Discord webhook.
|
|
3
6
|
*/
|
|
4
7
|
import type { APIWebhook, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery } from '../types';
|
|
5
|
-
import type { UsingClient } from '../commands';
|
|
6
|
-
import type { ImageOptions, MessageWebhookCreateBodyRequest, MessageWebhookPayload, MessageWebhookUpdateBodyRequest, MethodContext, ObjectToLower } from '../common';
|
|
7
8
|
import { DiscordBase } from './extra/DiscordBase';
|
|
8
|
-
import { type AnonymousGuildStructure, type UserStructure } from '../client/transformers';
|
|
9
9
|
export interface Webhook extends DiscordBase, ObjectToLower<Omit<APIWebhook, 'user' | 'source_guild'>> {
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Webhook = void 0;
|
|
4
|
-
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
5
4
|
const transformers_1 = require("../client/transformers");
|
|
5
|
+
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
6
6
|
/**
|
|
7
7
|
* Represents a Discord webhook.
|
|
8
8
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Collection, type RawFile } from '..';
|
|
2
|
+
import { type BaseChannelStructure, type BaseGuildChannelStructure, type CategoryChannelStructure, type DMChannelStructure, type DirectoryChannelStructure, type ForumChannelStructure, type MediaChannelStructure, type NewsChannelStructure, type StageChannelStructure, type TextGuildChannelStructure, type ThreadChannelStructure, type VoiceChannelStructure } from '../client/transformers';
|
|
2
3
|
import type { UsingClient } from '../commands';
|
|
3
4
|
import type { EmojiResolvable, MessageCreateBodyRequest, MessageUpdateBodyRequest, MethodContext, ObjectToLower, StringToNumber, ToClass } from '../common';
|
|
5
|
+
import { type APIChannelBase, type APIDMChannel, type APIGuildCategoryChannel, type APIGuildChannel, type APIGuildForumChannel, type APIGuildForumDefaultReactionEmoji, type APIGuildForumTag, type APIGuildMediaChannel, type APIGuildStageVoiceChannel, type APIGuildVoiceChannel, type APINewsChannel, type APITextChannel, type APIThreadChannel, ChannelType, type RESTGetAPIChannelMessageReactionUsersQuery, type RESTPatchAPIChannelJSONBody, type RESTPatchAPIGuildChannelPositionsJSONBody, type RESTPostAPIChannelWebhookJSONBody, type RESTPostAPIGuildChannelJSONBody, type RESTPostAPIGuildForumThreadsJSONBody, type SortOrderType, type ThreadAutoArchiveDuration, VideoQualityMode } from '../types';
|
|
4
6
|
import type { GuildMember } from './GuildMember';
|
|
5
7
|
import type { GuildRole } from './GuildRole';
|
|
6
8
|
import { DiscordBase } from './extra/DiscordBase';
|
|
7
|
-
import { Collection, type RawFile } from '..';
|
|
8
|
-
import { type BaseChannelStructure, type BaseGuildChannelStructure, type CategoryChannelStructure, type DMChannelStructure, type DirectoryChannelStructure, type ForumChannelStructure, type MediaChannelStructure, type NewsChannelStructure, type StageChannelStructure, type TextGuildChannelStructure, type ThreadChannelStructure, type VoiceChannelStructure } from '../client/transformers';
|
|
9
9
|
export declare class BaseChannel<T extends ChannelType> extends DiscordBase<APIChannelBase<ChannelType>> {
|
|
10
10
|
type: T;
|
|
11
11
|
constructor(client: UsingClient, data: APIChannelBase<ChannelType>);
|
|
@@ -35,7 +35,7 @@ export declare class BaseChannel<T extends ChannelType> extends DiscordBase<APIC
|
|
|
35
35
|
guildId: string;
|
|
36
36
|
}>): {
|
|
37
37
|
list: (force?: boolean) => Promise<AllChannels[]>;
|
|
38
|
-
fetch: (id: string, force?: boolean) => Promise<
|
|
38
|
+
fetch: (id: string, force?: boolean) => Promise<APIGuildCategoryChannel | APIGuildStageVoiceChannel | APIGuildVoiceChannel | APINewsChannel | APITextChannel | BaseChannel<ChannelType> | DMChannel | CategoryChannel>;
|
|
39
39
|
create: (body: RESTPostAPIGuildChannelJSONBody) => Promise<AllChannels>;
|
|
40
40
|
delete: (id: string, reason?: string) => Promise<AllChannels>;
|
|
41
41
|
edit: (id: string, body: RESTPatchAPIChannelJSONBody, reason?: string) => Promise<AllChannels>;
|
|
@@ -8,12 +8,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.DirectoryChannel = exports.NewsChannel = exports.CategoryChannel = exports.ThreadChannel = exports.ForumChannel = exports.MediaChannel = exports.StageChannel = exports.VoiceChannel = exports.DMChannel = exports.TextGuildChannel = exports.WebhookChannelMethods = exports.WebhookGuildMethods = exports.VoiceChannelMethods = exports.ThreadOnlyMethods = exports.TopicableGuildChannel = exports.TextBaseGuildChannel = exports.MessagesMethods = exports.BaseGuildChannel = exports.BaseChannel = void 0;
|
|
10
10
|
exports.channelFrom = channelFrom;
|
|
11
|
-
const types_1 = require("../types");
|
|
12
|
-
const builders_1 = require("../builders");
|
|
13
|
-
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
14
11
|
const __1 = require("..");
|
|
12
|
+
const builders_1 = require("../builders");
|
|
15
13
|
const transformers_1 = require("../client/transformers");
|
|
16
14
|
const mixer_1 = require("../deps/mixer");
|
|
15
|
+
const types_1 = require("../types");
|
|
16
|
+
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
17
17
|
class BaseChannel extends DiscordBase_1.DiscordBase {
|
|
18
18
|
constructor(client, data) {
|
|
19
19
|
super(client, data);
|
|
@@ -101,7 +101,7 @@ class BaseGuildChannel extends BaseChannel {
|
|
|
101
101
|
}
|
|
102
102
|
permissionOverwrites = {
|
|
103
103
|
fetch: () => this.client.cache.overwrites?.get(this.id),
|
|
104
|
-
values: () => (this.guildId ? this.client.cache.overwrites?.values(this.guildId) ?? [] : []),
|
|
104
|
+
values: () => (this.guildId ? (this.client.cache.overwrites?.values(this.guildId) ?? []) : []),
|
|
105
105
|
};
|
|
106
106
|
memberPermissions(member, checkAdmin = true) {
|
|
107
107
|
return this.client.channels.memberPermissions(this.id, member, checkAdmin);
|
|
@@ -184,9 +184,9 @@ class MessagesMethods extends DiscordBase_1.DiscordBase {
|
|
|
184
184
|
})) ?? undefined;
|
|
185
185
|
}
|
|
186
186
|
else if (files?.length) {
|
|
187
|
-
payload.attachments = files?.map((
|
|
187
|
+
payload.attachments = files?.map(({ filename }, id) => ({
|
|
188
188
|
id,
|
|
189
|
-
filename
|
|
189
|
+
filename,
|
|
190
190
|
}));
|
|
191
191
|
}
|
|
192
192
|
return payload;
|
|
@@ -223,11 +223,12 @@ function channelFrom(data, client) {
|
|
|
223
223
|
return transformers_1.Transformers.CategoryChannel(client, data);
|
|
224
224
|
case types_1.ChannelType.GuildAnnouncement:
|
|
225
225
|
return transformers_1.Transformers.NewsChannel(client, data);
|
|
226
|
-
default:
|
|
226
|
+
default: {
|
|
227
227
|
if ('guild_id' in data) {
|
|
228
228
|
return transformers_1.Transformers.BaseGuildChannel(client, data);
|
|
229
229
|
}
|
|
230
230
|
return transformers_1.Transformers.BaseChannel(client, data);
|
|
231
|
+
}
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
class TopicableGuildChannel extends DiscordBase_1.DiscordBase {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ObjectToLower } from '../../common';
|
|
2
2
|
import type { ImageOptions } from '../../common/types/options';
|
|
3
3
|
import { type APIPartialGuild } from '../../types';
|
|
4
4
|
import { DiscordBase } from './DiscordBase';
|
|
@@ -37,5 +37,15 @@ export declare class BaseGuild extends DiscordBase<APIPartialGuild> {
|
|
|
37
37
|
* @returns Banner url or void
|
|
38
38
|
*/
|
|
39
39
|
bannerURL(options?: ImageOptions): string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Shard ID of the guild.
|
|
42
|
+
* @returns Shard ID or -1 if the client is not gateway based.
|
|
43
|
+
*/
|
|
44
|
+
get shardId(): number;
|
|
45
|
+
/**
|
|
46
|
+
* Shard of the guild.
|
|
47
|
+
* @returns Shard or undefined, if the client is not gateway based always undefined.
|
|
48
|
+
*/
|
|
49
|
+
get shard(): import("../../websocket").Shard | undefined;
|
|
40
50
|
toString(): string;
|
|
41
51
|
}
|