@buape/carbon 0.8.0 → 0.10.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/dist/package.json +7 -7
- package/dist/src/abstracts/AnySelectMenu.d.ts +2 -1
- package/dist/src/abstracts/AnySelectMenu.d.ts.map +1 -1
- package/dist/src/abstracts/AnySelectMenu.js +6 -0
- package/dist/src/abstracts/AnySelectMenu.js.map +1 -1
- package/dist/src/abstracts/AnySelectMenuInteraction.d.ts +0 -1
- package/dist/src/abstracts/AnySelectMenuInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/AnySelectMenuInteraction.js +0 -2
- package/dist/src/abstracts/AnySelectMenuInteraction.js.map +1 -1
- package/dist/src/abstracts/BaseChannel.d.ts +10 -1
- package/dist/src/abstracts/BaseChannel.d.ts.map +1 -1
- package/dist/src/abstracts/BaseChannel.js +13 -0
- package/dist/src/abstracts/BaseChannel.js.map +1 -1
- package/dist/src/abstracts/BaseCommand.d.ts +18 -8
- package/dist/src/abstracts/BaseCommand.d.ts.map +1 -1
- package/dist/src/abstracts/BaseCommand.js +24 -7
- package/dist/src/abstracts/BaseCommand.js.map +1 -1
- package/dist/src/abstracts/BaseComponentInteraction.d.ts +0 -1
- package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseComponentInteraction.js +3 -3
- package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -1
- package/dist/src/abstracts/BaseGuildChannel.d.ts +3 -2
- package/dist/src/abstracts/BaseGuildChannel.d.ts.map +1 -1
- package/dist/src/abstracts/BaseGuildChannel.js +5 -3
- package/dist/src/abstracts/BaseGuildChannel.js.map +1 -1
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts +1 -1
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts.map +1 -1
- package/dist/src/abstracts/BaseInteraction.d.ts +45 -2
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseInteraction.js +99 -14
- package/dist/src/abstracts/BaseInteraction.js.map +1 -1
- package/dist/src/abstracts/BaseMessageInteractiveComponent.d.ts +18 -12
- package/dist/src/abstracts/BaseMessageInteractiveComponent.d.ts.map +1 -1
- package/dist/src/abstracts/BaseMessageInteractiveComponent.js +18 -18
- package/dist/src/abstracts/BaseMessageInteractiveComponent.js.map +1 -1
- package/dist/src/abstracts/BaseModalComponent.d.ts +16 -10
- package/dist/src/abstracts/BaseModalComponent.d.ts.map +1 -1
- package/dist/src/abstracts/BaseModalComponent.js +25 -17
- package/dist/src/abstracts/BaseModalComponent.js.map +1 -1
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts +11 -4
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts.map +1 -1
- package/dist/src/abstracts/GuildThreadOnlyChannel.js +14 -1
- package/dist/src/abstracts/GuildThreadOnlyChannel.js.map +1 -1
- package/dist/src/abstracts/Plugin.d.ts +1 -1
- package/dist/src/abstracts/Plugin.d.ts.map +1 -1
- package/dist/src/classes/Client.d.ts +32 -8
- package/dist/src/classes/Client.d.ts.map +1 -1
- package/dist/src/classes/Client.js +76 -17
- package/dist/src/classes/Client.js.map +1 -1
- package/dist/src/classes/ClientWithCaching.d.ts +51 -0
- package/dist/src/classes/ClientWithCaching.d.ts.map +1 -0
- package/dist/src/classes/ClientWithCaching.js +108 -0
- package/dist/src/classes/ClientWithCaching.js.map +1 -0
- package/dist/src/classes/Command.d.ts +10 -2
- package/dist/src/classes/Command.d.ts.map +1 -1
- package/dist/src/classes/Command.js +12 -1
- package/dist/src/classes/Command.js.map +1 -1
- package/dist/src/classes/Listener.d.ts +20 -0
- package/dist/src/classes/Listener.d.ts.map +1 -1
- package/dist/src/classes/Listener.js +116 -14
- package/dist/src/classes/Listener.js.map +1 -1
- package/dist/src/classes/Modal.d.ts +19 -2
- package/dist/src/classes/Modal.d.ts.map +1 -1
- package/dist/src/classes/Modal.js +14 -0
- package/dist/src/classes/Modal.js.map +1 -1
- package/dist/src/classes/RequestClient.d.ts +7 -5
- package/dist/src/classes/RequestClient.d.ts.map +1 -1
- package/dist/src/classes/RequestClient.js +28 -16
- package/dist/src/classes/RequestClient.js.map +1 -1
- package/dist/src/classes/components/Button.d.ts +3 -1
- package/dist/src/classes/components/Button.d.ts.map +1 -1
- package/dist/src/classes/components/Button.js +10 -1
- package/dist/src/classes/components/Button.js.map +1 -1
- package/dist/src/classes/components/ChannelSelectMenu.d.ts +2 -1
- package/dist/src/classes/components/ChannelSelectMenu.d.ts.map +1 -1
- package/dist/src/classes/components/ChannelSelectMenu.js +6 -0
- package/dist/src/classes/components/ChannelSelectMenu.js.map +1 -1
- package/dist/src/classes/components/Container.d.ts +0 -3
- package/dist/src/classes/components/Container.d.ts.map +1 -1
- package/dist/src/classes/components/Container.js +0 -3
- package/dist/src/classes/components/Container.js.map +1 -1
- package/dist/src/classes/components/MentionableSelectMenu.d.ts +2 -1
- package/dist/src/classes/components/MentionableSelectMenu.d.ts.map +1 -1
- package/dist/src/classes/components/MentionableSelectMenu.js +6 -0
- package/dist/src/classes/components/MentionableSelectMenu.js.map +1 -1
- package/dist/src/classes/components/RoleSelectMenu.d.ts +2 -1
- package/dist/src/classes/components/RoleSelectMenu.d.ts.map +1 -1
- package/dist/src/classes/components/RoleSelectMenu.js +6 -0
- package/dist/src/classes/components/RoleSelectMenu.js.map +1 -1
- package/dist/src/classes/components/StringSelectMenu.d.ts +2 -1
- package/dist/src/classes/components/StringSelectMenu.d.ts.map +1 -1
- package/dist/src/classes/components/StringSelectMenu.js +6 -0
- package/dist/src/classes/components/StringSelectMenu.js.map +1 -1
- package/dist/src/classes/components/UserSelectMenu.d.ts +2 -1
- package/dist/src/classes/components/UserSelectMenu.d.ts.map +1 -1
- package/dist/src/classes/components/UserSelectMenu.js +6 -0
- package/dist/src/classes/components/UserSelectMenu.js.map +1 -1
- package/dist/src/functions/enforceChoicesLimit.d.ts +3 -0
- package/dist/src/functions/enforceChoicesLimit.d.ts.map +1 -0
- package/dist/src/functions/enforceChoicesLimit.js +17 -0
- package/dist/src/functions/enforceChoicesLimit.js.map +1 -0
- package/dist/src/functions/errorsMapper.d.ts.map +1 -1
- package/dist/src/functions/errorsMapper.js +13 -1
- package/dist/src/functions/errorsMapper.js.map +1 -1
- package/dist/src/index.d.ts +8 -54
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/internals/AutocompleteInteraction.d.ts +9 -3
- package/dist/src/internals/AutocompleteInteraction.d.ts.map +1 -1
- package/dist/src/internals/AutocompleteInteraction.js +13 -3
- package/dist/src/internals/AutocompleteInteraction.js.map +1 -1
- package/dist/src/internals/ButtonInteraction.d.ts +0 -1
- package/dist/src/internals/ButtonInteraction.d.ts.map +1 -1
- package/dist/src/internals/ButtonInteraction.js +0 -2
- package/dist/src/internals/ButtonInteraction.js.map +1 -1
- package/dist/src/internals/Cache.d.ts +76 -0
- package/dist/src/internals/Cache.d.ts.map +1 -0
- package/dist/src/internals/Cache.js +122 -0
- package/dist/src/internals/Cache.js.map +1 -0
- package/dist/src/internals/CommandHandler.d.ts +2 -1
- package/dist/src/internals/CommandHandler.d.ts.map +1 -1
- package/dist/src/internals/CommandHandler.js +44 -13
- package/dist/src/internals/CommandHandler.js.map +1 -1
- package/dist/src/internals/CommandInteraction.d.ts +7 -1
- package/dist/src/internals/CommandInteraction.d.ts.map +1 -1
- package/dist/src/internals/CommandInteraction.js +10 -4
- package/dist/src/internals/CommandInteraction.js.map +1 -1
- package/dist/src/internals/ComponentHandler.d.ts +5 -2
- package/dist/src/internals/ComponentHandler.d.ts.map +1 -1
- package/dist/src/internals/ComponentHandler.js +34 -10
- package/dist/src/internals/ComponentHandler.js.map +1 -1
- package/dist/src/internals/ModalHandler.d.ts +1 -1
- package/dist/src/internals/ModalHandler.d.ts.map +1 -1
- package/dist/src/internals/ModalHandler.js +6 -2
- package/dist/src/internals/ModalHandler.js.map +1 -1
- package/dist/src/internals/ModalInteraction.js +1 -1
- package/dist/src/internals/ModalInteraction.js.map +1 -1
- package/dist/src/internals/OptionsHandler.d.ts +13 -3
- package/dist/src/internals/OptionsHandler.d.ts.map +1 -1
- package/dist/src/internals/OptionsHandler.js +51 -1
- package/dist/src/internals/OptionsHandler.js.map +1 -1
- package/dist/src/permissions.d.ts +54 -0
- package/dist/src/permissions.d.ts.map +1 -0
- package/dist/src/permissions.js +4 -0
- package/dist/src/permissions.js.map +1 -0
- package/dist/src/plugins/command-data/CommandDataPlugin.d.ts +16 -0
- package/dist/src/plugins/command-data/CommandDataPlugin.d.ts.map +1 -0
- package/dist/src/plugins/command-data/CommandDataPlugin.js +46 -0
- package/dist/src/plugins/command-data/CommandDataPlugin.js.map +1 -0
- package/dist/src/plugins/command-data/index.d.ts +2 -0
- package/dist/src/plugins/command-data/index.d.ts.map +1 -0
- package/dist/src/plugins/command-data/index.js +2 -0
- package/dist/src/plugins/command-data/index.js.map +1 -0
- package/dist/src/plugins/gateway/GatewayPlugin.d.ts +47 -3
- package/dist/src/plugins/gateway/GatewayPlugin.d.ts.map +1 -1
- package/dist/src/plugins/gateway/GatewayPlugin.js +169 -22
- package/dist/src/plugins/gateway/GatewayPlugin.js.map +1 -1
- package/dist/src/plugins/gateway/types.d.ts +58 -0
- package/dist/src/plugins/gateway/types.d.ts.map +1 -1
- package/dist/src/plugins/gateway/types.js.map +1 -1
- package/dist/src/plugins/gateway/utils/monitor.d.ts +2 -0
- package/dist/src/plugins/gateway/utils/monitor.d.ts.map +1 -1
- package/dist/src/plugins/gateway/utils/monitor.js +10 -1
- package/dist/src/plugins/gateway/utils/monitor.js.map +1 -1
- package/dist/src/plugins/gateway/utils/payload.d.ts +8 -5
- package/dist/src/plugins/gateway/utils/payload.d.ts.map +1 -1
- package/dist/src/plugins/gateway/utils/payload.js +20 -1
- package/dist/src/plugins/gateway/utils/payload.js.map +1 -1
- package/dist/src/plugins/gateway/utils/rateLimit.d.ts +41 -0
- package/dist/src/plugins/gateway/utils/rateLimit.d.ts.map +1 -0
- package/dist/src/plugins/gateway/utils/rateLimit.js +61 -0
- package/dist/src/plugins/gateway/utils/rateLimit.js.map +1 -0
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.d.ts +1 -1
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.d.ts.map +1 -1
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.js +2 -2
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.js.map +1 -1
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.d.ts +10 -0
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.d.ts.map +1 -0
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.js +11 -0
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.js.map +1 -0
- package/dist/src/plugins/gateway-forwarder/index.d.ts +1 -0
- package/dist/src/plugins/gateway-forwarder/index.d.ts.map +1 -1
- package/dist/src/plugins/gateway-forwarder/index.js +1 -0
- package/dist/src/plugins/gateway-forwarder/index.js.map +1 -1
- package/dist/src/plugins/paginator/GoToPageModal.d.ts +24 -0
- package/dist/src/plugins/paginator/GoToPageModal.d.ts.map +1 -0
- package/dist/src/plugins/paginator/GoToPageModal.js +50 -0
- package/dist/src/plugins/paginator/GoToPageModal.js.map +1 -0
- package/dist/src/plugins/paginator/Paginator.d.ts +53 -0
- package/dist/src/plugins/paginator/Paginator.d.ts.map +1 -0
- package/dist/src/plugins/paginator/Paginator.js +183 -0
- package/dist/src/plugins/paginator/Paginator.js.map +1 -0
- package/dist/src/plugins/paginator/index.d.ts +9 -0
- package/dist/src/plugins/paginator/index.d.ts.map +1 -0
- package/dist/src/plugins/paginator/index.js +9 -0
- package/dist/src/plugins/paginator/index.js.map +1 -0
- package/dist/src/plugins/sharding/ShardingPlugin.d.ts +3 -1
- package/dist/src/plugins/sharding/ShardingPlugin.d.ts.map +1 -1
- package/dist/src/plugins/sharding/ShardingPlugin.js +11 -2
- package/dist/src/plugins/sharding/ShardingPlugin.js.map +1 -1
- package/dist/src/structures/DmChannel.d.ts +3 -3
- package/dist/src/structures/DmChannel.d.ts.map +1 -1
- package/dist/src/structures/DmChannel.js +5 -3
- package/dist/src/structures/DmChannel.js.map +1 -1
- package/dist/src/structures/GroupDmChannel.d.ts +1 -1
- package/dist/src/structures/GroupDmChannel.d.ts.map +1 -1
- package/dist/src/structures/Guild.d.ts +184 -5
- package/dist/src/structures/Guild.d.ts.map +1 -1
- package/dist/src/structures/Guild.js +406 -12
- package/dist/src/structures/Guild.js.map +1 -1
- package/dist/src/structures/GuildCategoryChannel.d.ts +1 -1
- package/dist/src/structures/GuildCategoryChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildForumChannel.d.ts +1 -1
- package/dist/src/structures/GuildForumChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildMember.d.ts +15 -12
- package/dist/src/structures/GuildMember.d.ts.map +1 -1
- package/dist/src/structures/GuildMember.js +78 -19
- package/dist/src/structures/GuildMember.js.map +1 -1
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts +1 -1
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildTextChannel.d.ts +1 -1
- package/dist/src/structures/GuildTextChannel.d.ts.map +1 -1
- package/dist/src/structures/GuildThreadChannel.d.ts +1 -1
- package/dist/src/structures/GuildThreadChannel.d.ts.map +1 -1
- package/dist/src/structures/Message.d.ts +29 -10
- package/dist/src/structures/Message.d.ts.map +1 -1
- package/dist/src/structures/Message.js +82 -18
- package/dist/src/structures/Message.js.map +1 -1
- package/dist/src/structures/Poll.d.ts +25 -0
- package/dist/src/structures/Poll.d.ts.map +1 -0
- package/dist/src/structures/Poll.js +45 -0
- package/dist/src/structures/Poll.js.map +1 -0
- package/dist/src/structures/Role.d.ts +29 -12
- package/dist/src/structures/Role.d.ts.map +1 -1
- package/dist/src/structures/Role.js +48 -21
- package/dist/src/structures/Role.js.map +1 -1
- package/dist/src/structures/ThreadMember.d.ts +36 -0
- package/dist/src/structures/ThreadMember.d.ts.map +1 -0
- package/dist/src/structures/ThreadMember.js +72 -0
- package/dist/src/structures/ThreadMember.js.map +1 -0
- package/dist/src/structures/User.d.ts +7 -2
- package/dist/src/structures/User.d.ts.map +1 -1
- package/dist/src/structures/User.js +8 -1
- package/dist/src/structures/User.js.map +1 -1
- package/dist/src/structures/Webhook.d.ts +135 -0
- package/dist/src/structures/Webhook.d.ts.map +1 -0
- package/dist/src/structures/Webhook.js +239 -0
- package/dist/src/structures/Webhook.js.map +1 -0
- package/dist/src/types/index.d.ts +73 -8
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/listeners.d.ts +71 -44
- package/dist/src/types/listeners.d.ts.map +1 -1
- package/dist/src/types/listeners.js.map +1 -1
- package/dist/src/utils/customIdParser.d.ts +3 -0
- package/dist/src/utils/customIdParser.d.ts.map +1 -0
- package/dist/src/utils/customIdParser.js +17 -0
- package/dist/src/utils/customIdParser.js.map +1 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +4 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/payload.d.ts +4 -0
- package/dist/src/utils/payload.d.ts.map +1 -0
- package/dist/src/utils/payload.js +45 -0
- package/dist/src/utils/payload.js.map +1 -0
- package/dist/src/utils/verification.d.ts +4 -0
- package/dist/src/utils/verification.d.ts.map +1 -0
- package/dist/src/utils/verification.js +52 -0
- package/dist/src/utils/verification.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/dist/src/utils.d.ts +0 -9
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/utils.js +0 -93
- package/dist/src/utils.js.map +0 -1
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buape/carbon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/src/index.js",
|
|
6
6
|
"repository": "github:buape/carbon",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@types/node": "^22.
|
|
29
|
-
"discord-api-types": "0.38.
|
|
28
|
+
"@types/node": "^22.15.17",
|
|
29
|
+
"discord-api-types": "0.38.5"
|
|
30
30
|
},
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
-
"@cloudflare/workers-types": "4.
|
|
33
|
-
"@hono/node-server": "1.
|
|
34
|
-
"@types/bun": "1.2.
|
|
32
|
+
"@cloudflare/workers-types": "4.20250513.0",
|
|
33
|
+
"@hono/node-server": "1.18.2",
|
|
34
|
+
"@types/bun": "1.2.20",
|
|
35
35
|
"@types/ws": "8.18.1",
|
|
36
|
-
"ws": "8.18.
|
|
36
|
+
"ws": "8.18.3"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { APIChannelSelectComponent, APIMentionableSelectComponent, APIRoleSelectComponent, APISelectMenuComponent, APIStringSelectComponent, APIUserSelectComponent, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import type { ComponentData } from "../types/index.js";
|
|
2
3
|
import type { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
|
|
3
4
|
import { BaseMessageInteractiveComponent } from "./BaseMessageInteractiveComponent.js";
|
|
4
5
|
export type AnySelectMenuComponentType = ComponentType.ChannelSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect | ComponentType.MentionableSelect;
|
|
5
6
|
export declare abstract class AnySelectMenu extends BaseMessageInteractiveComponent {
|
|
6
7
|
abstract type: AnySelectMenuComponentType;
|
|
7
|
-
|
|
8
|
+
run(interaction: AnySelectMenuInteraction, data: ComponentData): unknown | Promise<unknown>;
|
|
8
9
|
minValues?: number;
|
|
9
10
|
maxValues?: number;
|
|
10
11
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnySelectMenu.d.ts","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"AnySelectMenu.d.ts","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAA;AACtF,MAAM,MAAM,0BAA0B,GACnC,aAAa,CAAC,aAAa,GAC3B,aAAa,CAAC,UAAU,GACxB,aAAa,CAAC,YAAY,GAC1B,aAAa,CAAC,UAAU,GACxB,aAAa,CAAC,iBAAiB,CAAA;AAElC,8BAAsB,aAAc,SAAQ,+BAA+B;IAC1E,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAA;IACzC,GAAG,CACF,WAAW,EAAE,wBAAwB,EACrC,IAAI,EAAE,aAAa,GACjB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAO7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,SAAS,QAAO,sBAAsB,CAUrC;IAED,QAAQ,CAAC,gBAAgB,IACtB;QACA,IAAI,EAAE,aAAa,CAAC,aAAa,CAAA;QACjC,aAAa,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAA;QACzD,cAAc,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,CAAA;KAC1D,GACD;QACA,IAAI,EAAE,aAAa,CAAC,YAAY,CAAA;QAChC,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAA;KAC3C,GACD;QACA,IAAI,EAAE,aAAa,CAAC,UAAU,CAAA;QAC9B,cAAc,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;KACvD,GACD;QACA,IAAI,EAAE,aAAa,CAAC,UAAU,CAAA;QAC9B,cAAc,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;KACvD,GACD;QACA,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAA;QACrC,cAAc,EAAE,6BAA6B,CAAC,gBAAgB,CAAC,CAAA;KAC9D;CACJ"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { BaseMessageInteractiveComponent } from "./BaseMessageInteractiveComponent.js";
|
|
2
2
|
export class AnySelectMenu extends BaseMessageInteractiveComponent {
|
|
3
|
+
run(interaction, data) {
|
|
4
|
+
// Random things to show the vars as used
|
|
5
|
+
typeof interaction === "string";
|
|
6
|
+
typeof data === "string";
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
3
9
|
minValues;
|
|
4
10
|
maxValues;
|
|
5
11
|
disabled;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnySelectMenu.js","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenu.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnySelectMenu.js","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenu.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAA;AAQtF,MAAM,OAAgB,aAAc,SAAQ,+BAA+B;IAE1E,GAAG,CACF,WAAqC,EACrC,IAAmB;QAEnB,yCAAyC;QACzC,OAAO,WAAW,KAAK,QAAQ,CAAA;QAC/B,OAAO,IAAI,KAAK,QAAQ,CAAA;QACxB,OAAM;IACP,CAAC;IAED,SAAS,CAAS;IAClB,SAAS,CAAS;IAClB,QAAQ,CAAU;IAClB,WAAW,CAAS;IAEpB,SAAS,GAAG,GAA2B,EAAE;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAA;QACvC,OAAO;YACN,GAAG,OAAO;YACV,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,UAAU,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACF,CAAC,CAAA;CAwBD"}
|
|
@@ -3,7 +3,6 @@ import type { Client } from "../classes/Client.js";
|
|
|
3
3
|
import { BaseComponentInteraction } from "./BaseComponentInteraction.js";
|
|
4
4
|
import type { InteractionDefaults } from "./BaseInteraction.js";
|
|
5
5
|
export declare abstract class AnySelectMenuInteraction extends BaseComponentInteraction {
|
|
6
|
-
customId: string;
|
|
7
6
|
constructor(client: Client, data: APIMessageComponentSelectMenuInteraction, defaults: InteractionDefaults);
|
|
8
7
|
/**
|
|
9
8
|
* The raw IDs of the selected options (either role/string/channel IDs or the IDs you provided in your options)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnySelectMenuInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,wCAAwC,EAG7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"AnySelectMenuInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,wCAAwC,EAG7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE/D,8BAAsB,wBAAyB,SAAQ,wBAAwB;gBAE7E,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,wCAAwC,EAC9C,QAAQ,EAAE,mBAAmB;IAU9B;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,EAAE,CAErB;CACD"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { InteractionType } from "discord-api-types/v10";
|
|
2
|
-
import { splitCustomId } from "../utils.js";
|
|
3
2
|
import { BaseComponentInteraction } from "./BaseComponentInteraction.js";
|
|
4
3
|
export class AnySelectMenuInteraction extends BaseComponentInteraction {
|
|
5
|
-
customId = splitCustomId(this.rawData.data.custom_id)[0];
|
|
6
4
|
constructor(client, data, defaults) {
|
|
7
5
|
super(client, data, defaults);
|
|
8
6
|
if (!data.data)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnySelectMenuInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,eAAe,EACf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AnySelectMenuInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,eAAe,EACf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAGxE,MAAM,OAAgB,wBAAyB,SAAQ,wBAAwB;IAC9E,YACC,MAAc,EACd,IAA8C,EAC9C,QAA6B;QAE7B,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,IAAI;YACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,gBAAgB,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,CAAC;IACF,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACT,OAAQ,IAAI,CAAC,OAAO,CAAC,IAA4C,CAAC,MAAM,CAAA;IACzE,CAAC;CACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type APIChannel, type ChannelFlags, type ChannelType } from "discord-api-types/v10";
|
|
2
2
|
import type { Client } from "../classes/Client.js";
|
|
3
|
-
import type { IfPartial } from "../
|
|
3
|
+
import type { IfPartial } from "../types/index.js";
|
|
4
4
|
import { Base } from "./Base.js";
|
|
5
5
|
export declare abstract class BaseChannel<Type extends ChannelType, IsPartial extends boolean = false> extends Base {
|
|
6
6
|
constructor(client: Client, rawDataOrId: IsPartial extends true ? string : Extract<APIChannel, {
|
|
@@ -41,5 +41,14 @@ export declare abstract class BaseChannel<Type extends ChannelType, IsPartial ex
|
|
|
41
41
|
* @returns A Promise that resolves to a non-partial channel
|
|
42
42
|
*/
|
|
43
43
|
fetch(): Promise<BaseChannel<Type, false>>;
|
|
44
|
+
/**
|
|
45
|
+
* Delete the channel
|
|
46
|
+
*/
|
|
47
|
+
delete(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the Discord mention format for this channel
|
|
50
|
+
* @returns The mention string in the format <#channelId>
|
|
51
|
+
*/
|
|
52
|
+
toString(): string;
|
|
44
53
|
}
|
|
45
54
|
//# sourceMappingURL=BaseChannel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseChannel.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"BaseChannel.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,8BAAsB,WAAW,CAChC,IAAI,SAAS,WAAW,EACxB,SAAS,SAAS,OAAO,GAAG,KAAK,CAChC,SAAQ,IAAI;gBAEZ,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,SAAS,IAAI,GAChC,MAAM,GACN,OAAO,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC;IAYvC;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,GAAG,IAAI,CAAO;IACpE,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC;IAI3D,SAAS,CAAC,QAAQ,CACjB,KAAK,EAAE,MAAM,OAAO,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,EAChD,KAAK,EAAE,OAAO;IAOf;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,IAAI,OAAO,IAAI,SAAS,CAEvB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAGrC;IAED;;;OAGG;IACH,IAAI,KAAK,IAAI,SAAS,CAAC,SAAS,EAAE,YAAY,GAAG,SAAS,CAAC,CAG1D;IAED;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAWhD;;OAEG;IACG,MAAM;IAIZ;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAGlB"}
|
|
@@ -65,5 +65,18 @@ export class BaseChannel extends Base {
|
|
|
65
65
|
this.setData(newData);
|
|
66
66
|
return this;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Delete the channel
|
|
70
|
+
*/
|
|
71
|
+
async delete() {
|
|
72
|
+
await this.client.rest.delete(Routes.channel(this.id));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns the Discord mention format for this channel
|
|
76
|
+
* @returns The mention string in the format <#channelId>
|
|
77
|
+
*/
|
|
78
|
+
toString() {
|
|
79
|
+
return `<#${this.id}>`;
|
|
80
|
+
}
|
|
68
81
|
}
|
|
69
82
|
//# sourceMappingURL=BaseChannel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseChannel.js","sourceRoot":"","sources":["../../../src/abstracts/BaseChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,IAAI,EAAE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"discord-api-types/v10";
|
|
2
|
-
import { ApplicationIntegrationType, type ArrayOrSingle, type BaseMessageInteractiveComponent, InteractionContextType, type
|
|
2
|
+
import { ApplicationIntegrationType, type ArrayOrSingle, type BaseMessageInteractiveComponent, InteractionContextType, type Permission } from "../index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Represents the base data of a command that the user creates
|
|
5
5
|
*/
|
|
@@ -11,7 +11,17 @@ export declare abstract class BaseCommand {
|
|
|
11
11
|
/**
|
|
12
12
|
* A description of the command
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The localized name of the command
|
|
17
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#localization
|
|
18
|
+
*/
|
|
19
|
+
nameLocalizations?: Record<string, string>;
|
|
20
|
+
/**
|
|
21
|
+
* The localized description of the command
|
|
22
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#localization
|
|
23
|
+
*/
|
|
24
|
+
descriptionLocalizations?: Record<string, string>;
|
|
15
25
|
/**
|
|
16
26
|
* Whether the command response should be automatically deferred
|
|
17
27
|
*/
|
|
@@ -38,15 +48,15 @@ export declare abstract class BaseCommand {
|
|
|
38
48
|
*/
|
|
39
49
|
permission?: ArrayOrSingle<(typeof Permission)[keyof typeof Permission]>;
|
|
40
50
|
/**
|
|
41
|
-
* The components that
|
|
42
|
-
*
|
|
51
|
+
* The components that this command uses.
|
|
52
|
+
* These will be registered with the client when the command is initialized.
|
|
43
53
|
*/
|
|
44
|
-
components
|
|
54
|
+
components?: BaseMessageInteractiveComponent[];
|
|
45
55
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
56
|
+
* The guild IDs this command should be deployed to (guild-specific deployment).
|
|
57
|
+
* If not set, the command is deployed globally.
|
|
48
58
|
*/
|
|
49
|
-
|
|
59
|
+
guildIds?: string[];
|
|
50
60
|
/**
|
|
51
61
|
* Serializes the command into a JSON object that can be sent to Discord
|
|
52
62
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseCommand.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,EACtB,KAAK,sCAAsC,EAC3C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,0BAA0B,EAC1B,KAAK,aAAa,EAClB,KAAK,+BAA+B,EACpC,sBAAsB,EACtB,KAAK,
|
|
1
|
+
{"version":3,"file":"BaseCommand.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,EACtB,KAAK,sCAAsC,EAC3C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,0BAA0B,EAC1B,KAAK,aAAa,EAClB,KAAK,+BAA+B,EACpC,sBAAsB,EACtB,KAAK,UAAU,EACf,MAAM,aAAa,CAAA;AAEpB;;GAEG;AACH,8BAAsB,WAAW;IAChC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjD;;OAEG;IACH,KAAK,UAAQ;IACb;;OAEG;IACH,SAAS,UAAQ;IACjB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;IACrC;;OAEG;IACH,gBAAgB,EAAE,0BAA0B,EAAE,CAG7C;IACD;;OAEG;IACH,QAAQ,EAAE,sBAAsB,EAAE,CAIjC;IAED;;;OAGG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC,CAAA;IAExE;;;OAGG;IACH,UAAU,CAAC,EAAE,+BAA+B,EAAE,CAAA;IAE9C;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IAEnB;;;OAGG;IACH,SAAS;IAyCT;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,IAAI,sCAAsC,CAAC,SAAS,CAAC;CAC9E"}
|
|
@@ -4,6 +4,20 @@ import { ApplicationIntegrationType, InteractionContextType } from "../index.js"
|
|
|
4
4
|
* Represents the base data of a command that the user creates
|
|
5
5
|
*/
|
|
6
6
|
export class BaseCommand {
|
|
7
|
+
/**
|
|
8
|
+
* A description of the command
|
|
9
|
+
*/
|
|
10
|
+
description;
|
|
11
|
+
/**
|
|
12
|
+
* The localized name of the command
|
|
13
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#localization
|
|
14
|
+
*/
|
|
15
|
+
nameLocalizations;
|
|
16
|
+
/**
|
|
17
|
+
* The localized description of the command
|
|
18
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#localization
|
|
19
|
+
*/
|
|
20
|
+
descriptionLocalizations;
|
|
7
21
|
/**
|
|
8
22
|
* Whether the command response should be automatically deferred
|
|
9
23
|
*/
|
|
@@ -33,15 +47,15 @@ export class BaseCommand {
|
|
|
33
47
|
*/
|
|
34
48
|
permission;
|
|
35
49
|
/**
|
|
36
|
-
* The components that
|
|
37
|
-
*
|
|
50
|
+
* The components that this command uses.
|
|
51
|
+
* These will be registered with the client when the command is initialized.
|
|
38
52
|
*/
|
|
39
|
-
components
|
|
53
|
+
components;
|
|
40
54
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
55
|
+
* The guild IDs this command should be deployed to (guild-specific deployment).
|
|
56
|
+
* If not set, the command is deployed globally.
|
|
43
57
|
*/
|
|
44
|
-
|
|
58
|
+
guildIds;
|
|
45
59
|
/**
|
|
46
60
|
* Serializes the command into a JSON object that can be sent to Discord
|
|
47
61
|
* @internal
|
|
@@ -54,8 +68,10 @@ export class BaseCommand {
|
|
|
54
68
|
if (this.type === ApplicationCommandType.ChatInput) {
|
|
55
69
|
const data = {
|
|
56
70
|
name: this.name,
|
|
71
|
+
name_localizations: this.nameLocalizations,
|
|
72
|
+
description: this.description ?? "",
|
|
73
|
+
description_localizations: this.descriptionLocalizations,
|
|
57
74
|
type: this.type,
|
|
58
|
-
description: this.description,
|
|
59
75
|
options: this.serializeOptions(),
|
|
60
76
|
integration_types: this.integrationTypes,
|
|
61
77
|
contexts: this.contexts,
|
|
@@ -69,6 +85,7 @@ export class BaseCommand {
|
|
|
69
85
|
}
|
|
70
86
|
const data = {
|
|
71
87
|
name: this.name,
|
|
88
|
+
name_localizations: this.nameLocalizations,
|
|
72
89
|
type: this.type,
|
|
73
90
|
options: this.serializeOptions(),
|
|
74
91
|
integration_types: this.integrationTypes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseCommand.js","sourceRoot":"","sources":["../../../src/abstracts/BaseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,EAEtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,0BAA0B,EAG1B,sBAAsB,
|
|
1
|
+
{"version":3,"file":"BaseCommand.js","sourceRoot":"","sources":["../../../src/abstracts/BaseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,EAEtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,0BAA0B,EAG1B,sBAAsB,EAEtB,MAAM,aAAa,CAAA;AAEpB;;GAEG;AACH,MAAM,OAAgB,WAAW;IAKhC;;OAEG;IACH,WAAW,CAAS;IACpB;;;OAGG;IACH,iBAAiB,CAAyB;IAC1C;;;OAGG;IACH,wBAAwB,CAAyB;IACjD;;OAEG;IACH,KAAK,GAAG,KAAK,CAAA;IACb;;OAEG;IACH,SAAS,GAAG,KAAK,CAAA;IAKjB;;OAEG;IACH,gBAAgB,GAAiC;QAChD,0BAA0B,CAAC,YAAY;QACvC,0BAA0B,CAAC,WAAW;KACtC,CAAA;IACD;;OAEG;IACH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AAI,CAAC,IAAI;YACf,kBAAkB,EAAE,IAAI,CAAC,iBAAiB;YAC1C,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE;YAChC,iBAAiB,EAAE,IAAI,CAAC,gBAAgB;YACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,0BAA0B,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;gBACzD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;gBACxD,CAAC,CAAC,IAAI,CAAC,UAAU;oBAChB,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE;oBACtB,CAAC,CAAC,IAAI;SACR,CAAA;QAED,OAAO,IAAI,CAAA;IACZ,CAAC;CAOD"}
|
|
@@ -3,7 +3,6 @@ import type { Client } from "../classes/Client.js";
|
|
|
3
3
|
import type { MessagePayload } from "../types/index.js";
|
|
4
4
|
import { BaseInteraction, type InteractionDefaults } from "./BaseInteraction.js";
|
|
5
5
|
export declare class BaseComponentInteraction extends BaseInteraction<APIMessageComponentInteraction> {
|
|
6
|
-
customId: string;
|
|
7
6
|
componentType: ComponentType;
|
|
8
7
|
constructor(client: Client, data: APIMessageComponentInteraction, defaults: InteractionDefaults);
|
|
9
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseComponentInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseComponentInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,8BAA8B,EACnC,KAAK,aAAa,EAIlB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,OAAO,EAAE,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAEhF,qBAAa,wBAAyB,SAAQ,eAAe,CAAC,8BAA8B,CAAC;IAC5F,
|
|
1
|
+
{"version":3,"file":"BaseComponentInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseComponentInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,8BAA8B,EACnC,KAAK,aAAa,EAIlB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,OAAO,EAAE,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAEhF,qBAAa,wBAAyB,SAAQ,eAAe,CAAC,8BAA8B,CAAC;IAC5F,aAAa,EAAE,aAAa,CAAA;gBAE3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,8BAA8B,EACpC,QAAQ,EAAE,mBAAmB;IAQ9B;;;OAGG;IACG,WAAW;IAYjB;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,cAAc;CAkBjC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { InteractionResponseType, Routes } from "discord-api-types/v10";
|
|
2
|
-
import { serializePayload
|
|
2
|
+
import { serializePayload } from "../utils/index.js";
|
|
3
3
|
import { BaseInteraction } from "./BaseInteraction.js";
|
|
4
4
|
export class BaseComponentInteraction extends BaseInteraction {
|
|
5
|
-
customId;
|
|
6
5
|
componentType;
|
|
7
6
|
constructor(client, data, defaults) {
|
|
8
7
|
super(client, data, defaults);
|
|
9
8
|
if (!data.data)
|
|
10
9
|
throw new Error("Invalid interaction data was used to create this class");
|
|
11
|
-
this.customId = splitCustomId(data.data.custom_id)[0];
|
|
12
10
|
this.componentType = data.data.component_type;
|
|
13
11
|
}
|
|
14
12
|
/**
|
|
@@ -28,6 +26,8 @@ export class BaseComponentInteraction extends BaseInteraction {
|
|
|
28
26
|
*/
|
|
29
27
|
async update(data) {
|
|
30
28
|
const serialized = serializePayload(data);
|
|
29
|
+
// Auto-register any components in the message
|
|
30
|
+
this._internalAutoRegisterComponentsOnSend(data);
|
|
31
31
|
await this.client.rest.post(Routes.interactionCallback(this.rawData.id, this.rawData.token), {
|
|
32
32
|
body: {
|
|
33
33
|
type: InteractionResponseType.UpdateMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseComponentInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/BaseComponentInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,uBAAuB,EAEvB,MAAM,EACN,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"BaseComponentInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/BaseComponentInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,uBAAuB,EAEvB,MAAM,EACN,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,eAAe,EAA4B,MAAM,sBAAsB,CAAA;AAEhF,MAAM,OAAO,wBAAyB,SAAQ,eAA+C;IAC5F,aAAa,CAAe;IAC5B,YACC,MAAc,EACd,IAAoC,EACpC,QAA6B;QAE7B,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,IAAI;YACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAA;IAC9C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW;QAChB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAC1B,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAC/D;YACC,IAAI,EAAE;gBACL,IAAI,EAAE,uBAAuB,CAAC,qBAAqB;aACT;SAC3C,CACD,CAAA;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,IAAoB;QAChC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;QAEzC,8CAA8C;QAC9C,IAAI,CAAC,qCAAqC,CAAC,IAAI,CAAC,CAAA;QAEhD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAC1B,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAC/D;YACC,IAAI,EAAE;gBACL,IAAI,EAAE,uBAAuB,CAAC,aAAa;gBAC3C,IAAI,EAAE;oBACL,GAAG,UAAU;iBACb;aACyC;SAC3C,CACD,CAAA;IACF,CAAC;CACD"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type APIGuildChannel, type GuildChannelType, type RESTGetAPIGuildInvitesResult, type RESTPostAPIChannelInviteJSONBody } from "discord-api-types/v10";
|
|
2
2
|
import { Guild } from "../structures/Guild.js";
|
|
3
3
|
import type { GuildCategoryChannel } from "../structures/GuildCategoryChannel.js";
|
|
4
|
+
import { Message } from "../structures/Message.js";
|
|
4
5
|
import type { MessagePayload } from "../types/index.js";
|
|
5
|
-
import type { IfPartial } from "../
|
|
6
|
+
import type { IfPartial } from "../types/index.js";
|
|
6
7
|
import { BaseChannel } from "./BaseChannel.js";
|
|
7
8
|
export declare abstract class BaseGuildChannel<Type extends GuildChannelType, IsPartial extends boolean = false> extends BaseChannel<Type, IsPartial> {
|
|
8
9
|
rawData: APIGuildChannel<Type> | null;
|
|
@@ -53,7 +54,7 @@ export declare abstract class BaseGuildChannel<Type extends GuildChannelType, Is
|
|
|
53
54
|
/**
|
|
54
55
|
* Send a message to the channel
|
|
55
56
|
*/
|
|
56
|
-
send(message: MessagePayload): Promise<
|
|
57
|
+
send(message: MessagePayload): Promise<Message<false>>;
|
|
57
58
|
/**
|
|
58
59
|
* Get the invites for the channel
|
|
59
60
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseGuildChannel.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"BaseGuildChannel.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EAGrC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,8BAAsB,gBAAgB,CACrC,IAAI,SAAS,gBAAgB,EAC7B,SAAS,SAAS,OAAO,GAAG,KAAK,CAChC,SAAQ,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC;IAE7B,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAE7C;;OAEG;IACH,IAAI,IAAI,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAGvC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAG1C;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAG3C;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,CAGlD;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAGxC;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAI7C;IAED;;;OAGG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM;IAS1B;;;OAGG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM;IASlC;;;OAGG;IACG,SAAS,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM;IAkBrD;;;OAGG;IACG,OAAO,CAAC,IAAI,EAAE,OAAO;IAS3B;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc;IAOlC;;OAEG;IACG,UAAU;IAMhB;;OAEG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,gCAAgC;IAM7D;;OAEG;IACG,aAAa;CAGnB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Routes } from "discord-api-types/v10";
|
|
2
2
|
import { Guild } from "../structures/Guild.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Message } from "../structures/Message.js";
|
|
4
|
+
import { serializePayload } from "../utils/index.js";
|
|
4
5
|
import { BaseChannel } from "./BaseChannel.js";
|
|
5
6
|
export class BaseGuildChannel extends BaseChannel {
|
|
6
7
|
/**
|
|
@@ -115,9 +116,10 @@ export class BaseGuildChannel extends BaseChannel {
|
|
|
115
116
|
* Send a message to the channel
|
|
116
117
|
*/
|
|
117
118
|
async send(message) {
|
|
118
|
-
this.client.rest.post(Routes.channelMessages(this.id), {
|
|
119
|
+
const data = (await this.client.rest.post(Routes.channelMessages(this.id), {
|
|
119
120
|
body: serializePayload(message)
|
|
120
|
-
});
|
|
121
|
+
}));
|
|
122
|
+
return new Message(this.client, data);
|
|
121
123
|
}
|
|
122
124
|
/**
|
|
123
125
|
* Get the invites for the channel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseGuildChannel.js","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildChannel.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BaseGuildChannel.js","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAON,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,OAAgB,gBAGpB,SAAQ,WAA4B;IAIrC;;OAEG;IACH,IAAI,IAAI;QACP,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAa,CAAA;IAClC,CAAC;IAED;;OAEG;IACH,IAAI,OAAO;QACV,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,QAAiB,CAAA;IACtC,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACX,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAA;IAC7B,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACX,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,O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ACjC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAC9B,CAAiC,CAAA;IACnC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,OAA0C;QAC5D,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACnE,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE;SACpB,CAAC,CAAmC,CAAA;IACtC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa;QAClB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IAC/D,CAAC;CACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type APIGuildTextChannel, type GuildTextChannelType, type RESTPostAPIChannelThreadsJSONBody } from "discord-api-types/v10";
|
|
2
2
|
import { GuildThreadChannel } from "../structures/GuildThreadChannel.js";
|
|
3
3
|
import { Message } from "../structures/Message.js";
|
|
4
|
-
import type { IfPartial } from "../
|
|
4
|
+
import type { IfPartial } from "../types/index.js";
|
|
5
5
|
import { BaseGuildChannel } from "./BaseGuildChannel.js";
|
|
6
6
|
export declare abstract class BaseGuildTextChannel<Type extends GuildTextChannelType, IsPartial extends boolean = false> extends BaseGuildChannel<Type, IsPartial> {
|
|
7
7
|
rawData: APIGuildTextChannel<Type> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseGuildTextChannel.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildTextChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAEzB,KAAK,iCAAiC,EAEtC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qC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AiB;IAOvB;;;OAGG;IACG,WAAW,CAAC,IAAI,EAAE,iCAAiC;CAMzD"}
|
|
@@ -35,12 +35,22 @@ export declare abstract class BaseInteraction<T extends APIInteraction> extends
|
|
|
35
35
|
get user(): User | null;
|
|
36
36
|
get channel(): import("../index.js").DmChannel<false> | import("../index.js").GroupDmChannel<false> | import("../index.js").GuildTextChannel<false> | import("../index.js").GuildVoiceChannel<false> | import("../index.js").GuildCategoryChannel<false> | import("../index.js").GuildAnnouncementChannel<false> | import("../index.js").GuildThreadChannel<import("discord-api-types/v10").ThreadChannelType, false> | import("../index.js").GuildStageChannel<false> | import("../index.js").GuildForumChannel<false> | import("../index.js").GuildMediaChannel | null;
|
|
37
37
|
get member(): GuildMember<false, true> | null;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
* Automatically register components found in a message payload when sending the message.
|
|
41
|
+
*/
|
|
42
|
+
protected _internalAutoRegisterComponentsOnSend(data: MessagePayload): void;
|
|
43
|
+
/**
|
|
44
|
+
* @internal
|
|
45
|
+
* Register components found in a message payload when sending the message.
|
|
46
|
+
*/
|
|
47
|
+
private _internalRegisterComponentsOnSend;
|
|
38
48
|
/**
|
|
39
49
|
* Reply to an interaction.
|
|
40
50
|
* If the interaction is deferred, this will edit the original response.
|
|
41
|
-
* @param data The
|
|
51
|
+
* @param data The message data to send
|
|
42
52
|
*/
|
|
43
|
-
reply(data: MessagePayload): Promise<
|
|
53
|
+
reply(data: MessagePayload, overrideAutoRegister?: boolean): Promise<Message<false>>;
|
|
44
54
|
/**
|
|
45
55
|
* Defer the interaction response. This is used automatically by commands that are set to defer.
|
|
46
56
|
* If the interaction is already deferred, this will do nothing.
|
|
@@ -58,5 +68,38 @@ export declare abstract class BaseInteraction<T extends APIInteraction> extends
|
|
|
58
68
|
* Send a followup message to the interaction
|
|
59
69
|
*/
|
|
60
70
|
followUp(reply: MessagePayload): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* This function will reply to the interaction and wait for a component to be pressed.
|
|
73
|
+
* Any components passed in the message will not have run() functions called and
|
|
74
|
+
* will only trigger the interaction.acknowledge() function.
|
|
75
|
+
* This function will also return a promise that resolves
|
|
76
|
+
* to the custom ID of the component that was pressed.
|
|
77
|
+
*
|
|
78
|
+
* @param data The message data to send
|
|
79
|
+
* @param timeout After this many milliseconds, the promise will resolve to null
|
|
80
|
+
*/
|
|
81
|
+
replyAndWaitForComponent(data: MessagePayload, timeout?: number): Promise<{
|
|
82
|
+
/**
|
|
83
|
+
* Whether the interaction was successful
|
|
84
|
+
*/
|
|
85
|
+
success: true;
|
|
86
|
+
/**
|
|
87
|
+
* The custom ID of the component that was pressed
|
|
88
|
+
*/
|
|
89
|
+
customId: string;
|
|
90
|
+
/**
|
|
91
|
+
* If this is a select menu, this will be the values of the selected options
|
|
92
|
+
*/
|
|
93
|
+
values?: string[];
|
|
94
|
+
} | {
|
|
95
|
+
/**
|
|
96
|
+
* Whether the interaction was successful
|
|
97
|
+
*/
|
|
98
|
+
success: false;
|
|
99
|
+
/**
|
|
100
|
+
* The reason the interaction failed
|
|
101
|
+
*/
|
|
102
|
+
reason: "timed out";
|
|
103
|
+
}>;
|
|
61
104
|
}
|
|
62
105
|
//# sourceMappingURL=BaseInteraction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"BaseInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,cAAc,EAGnB,KAAK,eAAe,EAOpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAEN,KAAK,MAAM,EAEX,KAAK,EACL,KAAK,EACL,OAAO,EACP,KAAK,KAAK,EAGV,IAAI,EAEJ,MAAM,aAAa,CAAA;AACpB,OAAO,E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