@buape/carbon 0.1.3 → 0.3.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 -2
- package/dist/src/abstracts/BaseCommand.d.ts +1 -6
- package/dist/src/abstracts/BaseCommand.d.ts.map +1 -1
- package/dist/src/abstracts/BaseCommand.js +0 -5
- package/dist/src/abstracts/BaseCommand.js.map +1 -1
- package/dist/src/abstracts/BaseComponentInteraction.d.ts +6 -1
- package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseComponentInteraction.js +12 -0
- package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -1
- package/dist/src/abstracts/BaseInteraction.d.ts +14 -7
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseInteraction.js +29 -8
- package/dist/src/abstracts/BaseInteraction.js.map +1 -1
- package/dist/src/classes/Client.d.ts +11 -0
- package/dist/src/classes/Client.d.ts.map +1 -1
- package/dist/src/classes/Client.js +43 -11
- package/dist/src/classes/Client.js.map +1 -1
- package/dist/src/classes/Modal.d.ts +21 -0
- package/dist/src/classes/Modal.d.ts.map +1 -0
- package/dist/src/classes/Modal.js +14 -0
- package/dist/src/classes/Modal.js.map +1 -0
- package/dist/src/classes/Row.d.ts +7 -9
- package/dist/src/classes/Row.d.ts.map +1 -1
- package/dist/src/classes/Row.js +5 -4
- package/dist/src/classes/Row.js.map +1 -1
- package/dist/src/classes/TextInput.d.ts +40 -0
- package/dist/src/classes/TextInput.d.ts.map +1 -0
- package/dist/src/classes/TextInput.js +44 -0
- package/dist/src/classes/TextInput.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internals/AutocompleteInteraction.d.ts +1 -1
- package/dist/src/internals/CommandHandler.d.ts +4 -0
- package/dist/src/internals/CommandHandler.d.ts.map +1 -1
- package/dist/src/internals/CommandHandler.js +4 -0
- package/dist/src/internals/CommandHandler.js.map +1 -1
- package/dist/src/internals/ComponentHandler.d.ts +11 -0
- package/dist/src/internals/ComponentHandler.d.ts.map +1 -1
- package/dist/src/internals/ComponentHandler.js +15 -4
- package/dist/src/internals/ComponentHandler.js.map +1 -1
- package/dist/src/internals/FieldsHandler.d.ts +27 -0
- package/dist/src/internals/FieldsHandler.d.ts.map +1 -0
- package/dist/src/internals/FieldsHandler.js +37 -0
- package/dist/src/internals/FieldsHandler.js.map +1 -0
- package/dist/src/internals/ModalHandler.d.ts +17 -0
- package/dist/src/internals/ModalHandler.d.ts.map +1 -0
- package/dist/src/internals/ModalHandler.js +25 -0
- package/dist/src/internals/ModalHandler.js.map +1 -0
- package/dist/src/internals/ModalInteraction.d.ts +10 -0
- package/dist/src/internals/ModalInteraction.d.ts.map +1 -0
- package/dist/src/internals/ModalInteraction.js +12 -0
- package/dist/src/internals/ModalInteraction.js.map +1 -0
- package/dist/src/internals/OptionsHandler.d.ts +33 -17
- package/dist/src/internals/OptionsHandler.d.ts.map +1 -1
- package/dist/src/internals/OptionsHandler.js +52 -58
- package/dist/src/internals/OptionsHandler.js.map +1 -1
- package/dist/src/utils.d.ts +3 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +54 -0
- package/dist/src/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -1
- package/.turbo/turbo-build.log +0 -5
- package/.turbo/turbo-dev.log +0 -175
- package/.turbo/turbo-docs.log +0 -12
- package/CHANGELOG.md +0 -34
- package/dist/src/abstracts/ButtonInteraction.d.ts +0 -8
- package/dist/src/abstracts/ButtonInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/ButtonInteraction.js +0 -18
- package/dist/src/abstracts/ButtonInteraction.js.map +0 -1
- package/dist/src/abstracts/ChannelSelectMenuInteraction.d.ts +0 -7
- package/dist/src/abstracts/ChannelSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/ChannelSelectMenuInteraction.js +0 -11
- package/dist/src/abstracts/ChannelSelectMenuInteraction.js.map +0 -1
- package/dist/src/abstracts/CommandHandler.d.ts +0 -6
- package/dist/src/abstracts/CommandHandler.d.ts.map +0 -1
- package/dist/src/abstracts/CommandHandler.js +0 -65
- package/dist/src/abstracts/CommandHandler.js.map +0 -1
- package/dist/src/abstracts/CommandInteraction.d.ts +0 -15
- package/dist/src/abstracts/CommandInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/CommandInteraction.js +0 -60
- package/dist/src/abstracts/CommandInteraction.js.map +0 -1
- package/dist/src/abstracts/ComponentHandler.d.ts +0 -6
- package/dist/src/abstracts/ComponentHandler.d.ts.map +0 -1
- package/dist/src/abstracts/ComponentHandler.js +0 -64
- package/dist/src/abstracts/ComponentHandler.js.map +0 -1
- package/dist/src/abstracts/MentionableSelectMenuInteraction.d.ts +0 -8
- package/dist/src/abstracts/MentionableSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/MentionableSelectMenuInteraction.js +0 -15
- package/dist/src/abstracts/MentionableSelectMenuInteraction.js.map +0 -1
- package/dist/src/abstracts/RoleSelectMenuInteraction.d.ts +0 -8
- package/dist/src/abstracts/RoleSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/RoleSelectMenuInteraction.js +0 -14
- package/dist/src/abstracts/RoleSelectMenuInteraction.js.map +0 -1
- package/dist/src/abstracts/StringSelectMenuInteraction.d.ts +0 -8
- package/dist/src/abstracts/StringSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/StringSelectMenuInteraction.js +0 -14
- package/dist/src/abstracts/StringSelectMenuInteraction.js.map +0 -1
- package/dist/src/abstracts/UserSelectMenuInteraction.d.ts +0 -8
- package/dist/src/abstracts/UserSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/UserSelectMenuInteraction.js +0 -14
- package/dist/src/abstracts/UserSelectMenuInteraction.js.map +0 -1
- package/dist/src/classes/Paginator.d.ts +0 -3
- package/dist/src/classes/Paginator.d.ts.map +0 -1
- package/dist/src/classes/Paginator.js +0 -3
- package/dist/src/classes/Paginator.js.map +0 -1
- package/dist/src/structures/AnySelectMenu.d.ts +0 -31
- package/dist/src/structures/AnySelectMenu.d.ts.map +0 -1
- package/dist/src/structures/AnySelectMenu.js +0 -19
- package/dist/src/structures/AnySelectMenu.js.map +0 -1
- package/dist/src/structures/AnySelectMenuInteraction.d.ts +0 -12
- package/dist/src/structures/AnySelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/AnySelectMenuInteraction.js +0 -21
- package/dist/src/structures/AnySelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/Base.d.ts +0 -10
- package/dist/src/structures/Base.d.ts.map +0 -1
- package/dist/src/structures/Base.js +0 -11
- package/dist/src/structures/Base.js.map +0 -1
- package/dist/src/structures/BaseCommand.d.ts +0 -64
- package/dist/src/structures/BaseCommand.d.ts.map +0 -1
- package/dist/src/structures/BaseCommand.js +0 -58
- package/dist/src/structures/BaseCommand.js.map +0 -1
- package/dist/src/structures/BaseComponent.d.ts +0 -34
- package/dist/src/structures/BaseComponent.d.ts.map +0 -1
- package/dist/src/structures/BaseComponent.js +0 -30
- package/dist/src/structures/BaseComponent.js.map +0 -1
- package/dist/src/structures/BaseComponentInteraction.d.ts +0 -9
- package/dist/src/structures/BaseComponentInteraction.d.ts.map +0 -1
- package/dist/src/structures/BaseComponentInteraction.js +0 -14
- package/dist/src/structures/BaseComponentInteraction.js.map +0 -1
- package/dist/src/structures/BaseInteraction.d.ts +0 -81
- package/dist/src/structures/BaseInteraction.d.ts.map +0 -1
- package/dist/src/structures/BaseInteraction.js +0 -99
- package/dist/src/structures/BaseInteraction.js.map +0 -1
- package/dist/src/structures/ButtonInteraction.d.ts +0 -8
- package/dist/src/structures/ButtonInteraction.d.ts.map +0 -1
- package/dist/src/structures/ButtonInteraction.js +0 -18
- package/dist/src/structures/ButtonInteraction.js.map +0 -1
- package/dist/src/structures/ChannelSelectMenuInteraction.d.ts +0 -7
- package/dist/src/structures/ChannelSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/ChannelSelectMenuInteraction.js +0 -11
- package/dist/src/structures/ChannelSelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/CommandHandler.d.ts +0 -6
- package/dist/src/structures/CommandHandler.d.ts.map +0 -1
- package/dist/src/structures/CommandHandler.js +0 -70
- package/dist/src/structures/CommandHandler.js.map +0 -1
- package/dist/src/structures/CommandInteraction.d.ts +0 -15
- package/dist/src/structures/CommandInteraction.d.ts.map +0 -1
- package/dist/src/structures/CommandInteraction.js +0 -60
- package/dist/src/structures/CommandInteraction.js.map +0 -1
- package/dist/src/structures/ComponentHandler.d.ts +0 -6
- package/dist/src/structures/ComponentHandler.d.ts.map +0 -1
- package/dist/src/structures/ComponentHandler.js +0 -64
- package/dist/src/structures/ComponentHandler.js.map +0 -1
- package/dist/src/structures/MentionableSelectMenuInteraction.d.ts +0 -8
- package/dist/src/structures/MentionableSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/MentionableSelectMenuInteraction.js +0 -15
- package/dist/src/structures/MentionableSelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/RoleSelectMenuInteraction.d.ts +0 -8
- package/dist/src/structures/RoleSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/RoleSelectMenuInteraction.js +0 -14
- package/dist/src/structures/RoleSelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/StringSelectMenuInteraction.d.ts +0 -8
- package/dist/src/structures/StringSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/StringSelectMenuInteraction.js +0 -14
- package/dist/src/structures/StringSelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/UserSelectMenuInteraction.d.ts +0 -8
- package/dist/src/structures/UserSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/UserSelectMenuInteraction.js +0 -14
- package/dist/src/structures/UserSelectMenuInteraction.js.map +0 -1
- package/dist/src/types.d.ts +0 -31
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -33
- package/dist/src/types.js.map +0 -1
- package/docs/classes/AnySelectMenu.mdx +0 -114
- package/docs/classes/AnySelectMenuInteraction.mdx +0 -175
- package/docs/classes/AutocompleteInteraction.mdx +0 -166
- package/docs/classes/AutocompleteOptionsHandler.mdx +0 -243
- package/docs/classes/BaseChannel.mdx +0 -97
- package/docs/classes/BaseCommand.mdx +0 -61
- package/docs/classes/BaseComponent.mdx +0 -55
- package/docs/classes/BaseComponentInteraction.mdx +0 -160
- package/docs/classes/BaseGuildChannel.mdx +0 -262
- package/docs/classes/BaseGuildTextChannel.mdx +0 -360
- package/docs/classes/BaseInteraction.mdx +0 -137
- package/docs/classes/Button.mdx +0 -99
- package/docs/classes/ButtonInteraction.mdx +0 -155
- package/docs/classes/ChannelSelectMenu.mdx +0 -122
- package/docs/classes/ChannelSelectMenuInteraction.mdx +0 -171
- package/docs/classes/Client.mdx +0 -48
- package/docs/classes/Command.mdx +0 -111
- package/docs/classes/CommandHandler.mdx +0 -65
- package/docs/classes/CommandInteraction.mdx +0 -155
- package/docs/classes/CommandWithSubcommandGroups.mdx +0 -73
- package/docs/classes/CommandWithSubcommands.mdx +0 -76
- package/docs/classes/ComponentHandler.mdx +0 -49
- package/docs/classes/DmChannel.mdx +0 -118
- package/docs/classes/GroupDmChannel.mdx +0 -197
- package/docs/classes/Guild.mdx +0 -157
- package/docs/classes/GuildAnnouncementChannel.mdx +0 -377
- package/docs/classes/GuildCategoryChannel.mdx +0 -272
- package/docs/classes/GuildForumChannel.mdx +0 -333
- package/docs/classes/GuildMediaChannel.mdx +0 -327
- package/docs/classes/GuildStageChannel.mdx +0 -276
- package/docs/classes/GuildStageOrVoiceChannel.mdx +0 -292
- package/docs/classes/GuildTextChannel.mdx +0 -367
- package/docs/classes/GuildThreadChannel.mdx +0 -425
- package/docs/classes/GuildThreadOnlyChannel.mdx +0 -333
- package/docs/classes/GuildVoiceChannel.mdx +0 -276
- package/docs/classes/LinkButton.mdx +0 -84
- package/docs/classes/MentionableSelectMenu.mdx +0 -120
- package/docs/classes/MentionableSelectMenuInteraction.mdx +0 -171
- package/docs/classes/Message.mdx +0 -126
- package/docs/classes/OptionsHandler.mdx +0 -203
- package/docs/classes/PremiumButton.mdx +0 -84
- package/docs/classes/Role.mdx +0 -228
- package/docs/classes/RoleSelectMenu.mdx +0 -120
- package/docs/classes/RoleSelectMenuInteraction.mdx +0 -171
- package/docs/classes/Row.mdx +0 -88
- package/docs/classes/StringSelectMenu.mdx +0 -120
- package/docs/classes/StringSelectMenuInteraction.mdx +0 -171
- package/docs/classes/User.mdx +0 -119
- package/docs/classes/UserSelectMenu.mdx +0 -120
- package/docs/classes/UserSelectMenuInteraction.mdx +0 -171
- package/docs/enumerations/ClientMode.mdx +0 -16
- package/docs/functions/channelFactory.mdx +0 -16
- package/docs/index.mdx +0 -83
- package/docs/type-aliases/AnySelectMenuComponentType.mdx +0 -5
- package/docs/type-aliases/ClientOptions.mdx +0 -20
- package/docs/type-aliases/CommandOptions.mdx +0 -5
- package/docs/type-aliases/ComponentAdditionalData.mdx +0 -9
- package/docs/type-aliases/InteractionFileData.mdx +0 -15
- package/docs/type-aliases/InteractionReplyData.mdx +0 -14
- package/docs/type-aliases/InteractionReplyOptions.mdx +0 -13
- package/docs/type-aliases/RawOptions.mdx +0 -9
- package/docs/type-aliases/meta.json +0 -3
- package/src/README.md +0 -7
- package/src/abstracts/AnySelectMenu.ts +0 -63
- package/src/abstracts/AnySelectMenuInteraction.ts +0 -29
- package/src/abstracts/Base.ts +0 -12
- package/src/abstracts/BaseChannel.ts +0 -73
- package/src/abstracts/BaseCommand.ts +0 -99
- package/src/abstracts/BaseComponent.ts +0 -49
- package/src/abstracts/BaseComponentInteraction.ts +0 -19
- package/src/abstracts/BaseGuildChannel.ts +0 -152
- package/src/abstracts/BaseGuildTextChannel.ts +0 -77
- package/src/abstracts/BaseInteraction.ts +0 -177
- package/src/abstracts/GuildThreadOnlyChannel.ts +0 -71
- package/src/classes/Button.ts +0 -95
- package/src/classes/ChannelSelectMenu.ts +0 -21
- package/src/classes/Client.ts +0 -254
- package/src/classes/Command.ts +0 -53
- package/src/classes/CommandWithSubcommandGroups.ts +0 -47
- package/src/classes/CommandWithSubcommands.ts +0 -35
- package/src/classes/MentionableSelectMenu.ts +0 -19
- package/src/classes/RoleSelectMenu.ts +0 -19
- package/src/classes/Row.ts +0 -44
- package/src/classes/StringSelectMenu.ts +0 -19
- package/src/classes/UserSelectMenu.ts +0 -19
- package/src/factories/channelFactory.ts +0 -43
- package/src/index.ts +0 -59
- package/src/internals/AutocompleteInteraction.ts +0 -107
- package/src/internals/ButtonInteraction.ts +0 -26
- package/src/internals/ChannelSelectMenuInteraction.ts +0 -15
- package/src/internals/CommandHandler.ts +0 -123
- package/src/internals/CommandInteraction.ts +0 -49
- package/src/internals/ComponentHandler.ts +0 -81
- package/src/internals/MentionableSelectMenuInteraction.ts +0 -21
- package/src/internals/OptionsHandler.ts +0 -148
- package/src/internals/RoleSelectMenuInteraction.ts +0 -20
- package/src/internals/StringSelectMenuInteraction.ts +0 -20
- package/src/internals/UserSelectMenuInteraction.ts +0 -20
- package/src/structures/DmChannel.ts +0 -31
- package/src/structures/GroupDmChannel.ts +0 -132
- package/src/structures/Guild.ts +0 -154
- package/src/structures/GuildAnnouncementChannel.ts +0 -20
- package/src/structures/GuildCategoryChannel.ts +0 -16
- package/src/structures/GuildForumChannel.ts +0 -20
- package/src/structures/GuildMediaChannel.ts +0 -13
- package/src/structures/GuildMember.ts +0 -231
- package/src/structures/GuildStageOrVoiceChannel.ts +0 -46
- package/src/structures/GuildTextChannel.ts +0 -21
- package/src/structures/GuildThreadChannel.ts +0 -150
- package/src/structures/Message.ts +0 -124
- package/src/structures/Role.ts +0 -201
- package/src/structures/User.ts +0 -153
- package/src/utils.ts +0 -13
- package/tests/index.test.ts +0 -4
- package/tsconfig.json +0 -12
- package/typedoc.json +0 -9
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: UserSelectMenuInteraction
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
This is the base type interaction, all interaction types extend from this
|
|
6
|
-
|
|
7
|
-
## Extends
|
|
8
|
-
|
|
9
|
-
- [`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction)
|
|
10
|
-
|
|
11
|
-
## Constructors
|
|
12
|
-
|
|
13
|
-
### new UserSelectMenuInteraction()
|
|
14
|
-
|
|
15
|
-
> **new UserSelectMenuInteraction**(`client`, `data`): [`UserSelectMenuInteraction`](/carbon/api/classes/UserSelectMenuInteraction)
|
|
16
|
-
|
|
17
|
-
#### Parameters
|
|
18
|
-
|
|
19
|
-
| Parameter | Type |
|
|
20
|
-
| ------ | ------ |
|
|
21
|
-
| `client` | [`Client`](/carbon/api/classes/Client) |
|
|
22
|
-
| `data` | `APIMessageComponentSelectMenuInteraction` |
|
|
23
|
-
|
|
24
|
-
#### Returns
|
|
25
|
-
|
|
26
|
-
[`UserSelectMenuInteraction`](/carbon/api/classes/UserSelectMenuInteraction)
|
|
27
|
-
|
|
28
|
-
#### Overrides
|
|
29
|
-
|
|
30
|
-
[`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).[`constructor`](/carbon/api/classes/AnySelectMenuInteraction#constructors)
|
|
31
|
-
|
|
32
|
-
## Properties
|
|
33
|
-
|
|
34
|
-
| Property | Type | Default value | Description | Inherited from |
|
|
35
|
-
| ------ | ------ | ------ | ------ | ------ |
|
|
36
|
-
| `_deferred` | `boolean` | `false` | **`Internal`** Whether the interaction is deferred already | [`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).`_deferred` |
|
|
37
|
-
| `client` | [`Client`](/carbon/api/classes/Client) | `undefined` | - | [`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).`client` |
|
|
38
|
-
| `componentType` | `ComponentType` | `undefined` | - | [`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).`componentType` |
|
|
39
|
-
| `customId` | `string` | `undefined` | - | [`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).`customId` |
|
|
40
|
-
| `rawData` | `APIMessageComponentInteraction` | `undefined` | The raw data of the interaction | [`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).`rawData` |
|
|
41
|
-
| `type` | `InteractionType` | `undefined` | The type of interaction | [`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).`type` |
|
|
42
|
-
| `userId` | `undefined` \| `string` | `undefined` | The user who sent the interaction | [`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).`userId` |
|
|
43
|
-
|
|
44
|
-
## Accessors
|
|
45
|
-
|
|
46
|
-
### channel
|
|
47
|
-
|
|
48
|
-
> `get` **channel**(): `null` \| [`DmChannel`](/carbon/api/classes/DmChannel) \| [`GroupDmChannel`](/carbon/api/classes/GroupDmChannel) \| [`GuildTextChannel`](/carbon/api/classes/GuildTextChannel) \| [`GuildVoiceChannel`](/carbon/api/classes/GuildVoiceChannel) \| [`GuildCategoryChannel`](/carbon/api/classes/GuildCategoryChannel) \| [`GuildAnnouncementChannel`](/carbon/api/classes/GuildAnnouncementChannel) \| [`GuildThreadChannel`](/carbon/api/classes/GuildThreadChannel)\<`ThreadChannelType`\> \| [`GuildStageChannel`](/carbon/api/classes/GuildStageChannel) \| [`GuildForumChannel`](/carbon/api/classes/GuildForumChannel) \| [`GuildMediaChannel`](/carbon/api/classes/GuildMediaChannel)
|
|
49
|
-
|
|
50
|
-
#### Returns
|
|
51
|
-
|
|
52
|
-
`null` \| [`DmChannel`](/carbon/api/classes/DmChannel) \| [`GroupDmChannel`](/carbon/api/classes/GroupDmChannel) \| [`GuildTextChannel`](/carbon/api/classes/GuildTextChannel) \| [`GuildVoiceChannel`](/carbon/api/classes/GuildVoiceChannel) \| [`GuildCategoryChannel`](/carbon/api/classes/GuildCategoryChannel) \| [`GuildAnnouncementChannel`](/carbon/api/classes/GuildAnnouncementChannel) \| [`GuildThreadChannel`](/carbon/api/classes/GuildThreadChannel)\<`ThreadChannelType`\> \| [`GuildStageChannel`](/carbon/api/classes/GuildStageChannel) \| [`GuildForumChannel`](/carbon/api/classes/GuildForumChannel) \| [`GuildMediaChannel`](/carbon/api/classes/GuildMediaChannel)
|
|
53
|
-
|
|
54
|
-
#### Inherited from
|
|
55
|
-
|
|
56
|
-
[`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).[`channel`](/carbon/api/classes/AnySelectMenuInteraction#channel)
|
|
57
|
-
|
|
58
|
-
***
|
|
59
|
-
|
|
60
|
-
### guild
|
|
61
|
-
|
|
62
|
-
> `get` **guild**(): `null` \| [`Guild`](/carbon/api/classes/Guild)
|
|
63
|
-
|
|
64
|
-
#### Returns
|
|
65
|
-
|
|
66
|
-
`null` \| [`Guild`](/carbon/api/classes/Guild)
|
|
67
|
-
|
|
68
|
-
#### Inherited from
|
|
69
|
-
|
|
70
|
-
[`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).[`guild`](/carbon/api/classes/AnySelectMenuInteraction#guild)
|
|
71
|
-
|
|
72
|
-
***
|
|
73
|
-
|
|
74
|
-
### member
|
|
75
|
-
|
|
76
|
-
> `get` **member**(): `null` \| `GuildMember`
|
|
77
|
-
|
|
78
|
-
#### Returns
|
|
79
|
-
|
|
80
|
-
`null` \| `GuildMember`
|
|
81
|
-
|
|
82
|
-
#### Inherited from
|
|
83
|
-
|
|
84
|
-
[`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).[`member`](/carbon/api/classes/AnySelectMenuInteraction#member)
|
|
85
|
-
|
|
86
|
-
***
|
|
87
|
-
|
|
88
|
-
### message
|
|
89
|
-
|
|
90
|
-
> `get` **message**(): `null` \| [`Message`](/carbon/api/classes/Message)
|
|
91
|
-
|
|
92
|
-
#### Returns
|
|
93
|
-
|
|
94
|
-
`null` \| [`Message`](/carbon/api/classes/Message)
|
|
95
|
-
|
|
96
|
-
#### Inherited from
|
|
97
|
-
|
|
98
|
-
[`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).[`message`](/carbon/api/classes/AnySelectMenuInteraction#message)
|
|
99
|
-
|
|
100
|
-
***
|
|
101
|
-
|
|
102
|
-
### user
|
|
103
|
-
|
|
104
|
-
> `get` **user**(): `null` \| [`User`](/carbon/api/classes/User)
|
|
105
|
-
|
|
106
|
-
#### Returns
|
|
107
|
-
|
|
108
|
-
`null` \| [`User`](/carbon/api/classes/User)
|
|
109
|
-
|
|
110
|
-
#### Inherited from
|
|
111
|
-
|
|
112
|
-
[`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).[`user`](/carbon/api/classes/AnySelectMenuInteraction#user)
|
|
113
|
-
|
|
114
|
-
***
|
|
115
|
-
|
|
116
|
-
### values
|
|
117
|
-
|
|
118
|
-
> `get` **values**(): `string`[]
|
|
119
|
-
|
|
120
|
-
The raw IDs of the selected options (either role/string/channel IDs or the IDs you provided in your options)
|
|
121
|
-
|
|
122
|
-
#### Returns
|
|
123
|
-
|
|
124
|
-
`string`[]
|
|
125
|
-
|
|
126
|
-
#### Overrides
|
|
127
|
-
|
|
128
|
-
[`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).[`values`](/carbon/api/classes/AnySelectMenuInteraction#values)
|
|
129
|
-
|
|
130
|
-
## Methods
|
|
131
|
-
|
|
132
|
-
### defer()
|
|
133
|
-
|
|
134
|
-
> **defer**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>
|
|
135
|
-
|
|
136
|
-
**`Internal`**
|
|
137
|
-
|
|
138
|
-
Defer the interaction response. This is used automatically by commands that are set to defer.
|
|
139
|
-
If the interaction is already deferred, this will do nothing.
|
|
140
|
-
|
|
141
|
-
#### Returns
|
|
142
|
-
|
|
143
|
-
[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>
|
|
144
|
-
|
|
145
|
-
#### Inherited from
|
|
146
|
-
|
|
147
|
-
[`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).[`defer`](/carbon/api/classes/AnySelectMenuInteraction#defer)
|
|
148
|
-
|
|
149
|
-
***
|
|
150
|
-
|
|
151
|
-
### reply()
|
|
152
|
-
|
|
153
|
-
> **reply**(`data`, `options`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>
|
|
154
|
-
|
|
155
|
-
Reply to an interaction.
|
|
156
|
-
If the interaction is deferred, this will edit the original response.
|
|
157
|
-
|
|
158
|
-
#### Parameters
|
|
159
|
-
|
|
160
|
-
| Parameter | Type | Description |
|
|
161
|
-
| ------ | ------ | ------ |
|
|
162
|
-
| `data` | [`InteractionReplyData`](/carbon/api/type-aliases/InteractionReplyData) | The response data |
|
|
163
|
-
| `options` | [`InteractionReplyOptions`](/carbon/api/type-aliases/InteractionReplyOptions) | - |
|
|
164
|
-
|
|
165
|
-
#### Returns
|
|
166
|
-
|
|
167
|
-
[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>
|
|
168
|
-
|
|
169
|
-
#### Inherited from
|
|
170
|
-
|
|
171
|
-
[`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction).[`reply`](/carbon/api/classes/AnySelectMenuInteraction#reply)
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: ClientMode
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
The mode that the client is running in.
|
|
6
|
-
Different platforms have different requirements for how processes are handled.
|
|
7
|
-
|
|
8
|
-
## Enumeration Members
|
|
9
|
-
|
|
10
|
-
| Enumeration Member | Value |
|
|
11
|
-
| ------ | ------ |
|
|
12
|
-
| `Bun` | `"bun"` |
|
|
13
|
-
| `CloudflareWorkers` | `"cloudflare"` |
|
|
14
|
-
| `NodeJS` | `"node"` |
|
|
15
|
-
| `Vercel` | `"vercel"` |
|
|
16
|
-
| `Web` | `"web"` |
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: channelFactory
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> **channelFactory**(`client`, `channelData`): `null` \| [`DmChannel`](/carbon/api/classes/DmChannel) \| [`GroupDmChannel`](/carbon/api/classes/GroupDmChannel) \| [`GuildTextChannel`](/carbon/api/classes/GuildTextChannel) \| [`GuildVoiceChannel`](/carbon/api/classes/GuildVoiceChannel) \| [`GuildCategoryChannel`](/carbon/api/classes/GuildCategoryChannel) \| [`GuildAnnouncementChannel`](/carbon/api/classes/GuildAnnouncementChannel) \| [`GuildThreadChannel`](/carbon/api/classes/GuildThreadChannel)\<`ThreadChannelType`\> \| [`GuildStageChannel`](/carbon/api/classes/GuildStageChannel) \| [`GuildForumChannel`](/carbon/api/classes/GuildForumChannel) \| [`GuildMediaChannel`](/carbon/api/classes/GuildMediaChannel)
|
|
6
|
-
|
|
7
|
-
## Parameters
|
|
8
|
-
|
|
9
|
-
| Parameter | Type |
|
|
10
|
-
| ------ | ------ |
|
|
11
|
-
| `client` | [`Client`](/carbon/api/classes/Client) |
|
|
12
|
-
| `channelData` | `APIChannel` |
|
|
13
|
-
|
|
14
|
-
## Returns
|
|
15
|
-
|
|
16
|
-
`null` \| [`DmChannel`](/carbon/api/classes/DmChannel) \| [`GroupDmChannel`](/carbon/api/classes/GroupDmChannel) \| [`GuildTextChannel`](/carbon/api/classes/GuildTextChannel) \| [`GuildVoiceChannel`](/carbon/api/classes/GuildVoiceChannel) \| [`GuildCategoryChannel`](/carbon/api/classes/GuildCategoryChannel) \| [`GuildAnnouncementChannel`](/carbon/api/classes/GuildAnnouncementChannel) \| [`GuildThreadChannel`](/carbon/api/classes/GuildThreadChannel)\<`ThreadChannelType`\> \| [`GuildStageChannel`](/carbon/api/classes/GuildStageChannel) \| [`GuildForumChannel`](/carbon/api/classes/GuildForumChannel) \| [`GuildMediaChannel`](/carbon/api/classes/GuildMediaChannel)
|
package/docs/index.mdx
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "@buape/carbon"
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Enumerations
|
|
6
|
-
|
|
7
|
-
| Enumeration | Description |
|
|
8
|
-
| ------ | ------ |
|
|
9
|
-
| [ClientMode](/carbon/api/enumerations/ClientMode) | The mode that the client is running in. Different platforms have different requirements for how processes are handled. |
|
|
10
|
-
|
|
11
|
-
## Classes
|
|
12
|
-
|
|
13
|
-
| Class | Description |
|
|
14
|
-
| ------ | ------ |
|
|
15
|
-
| [AnySelectMenu](/carbon/api/classes/AnySelectMenu) | - |
|
|
16
|
-
| [AnySelectMenuInteraction](/carbon/api/classes/AnySelectMenuInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
17
|
-
| [AutocompleteInteraction](/carbon/api/classes/AutocompleteInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
18
|
-
| [AutocompleteOptionsHandler](/carbon/api/classes/AutocompleteOptionsHandler) | This class is used to parse the options of a command, and provide errors for any missing or invalid options. It is used internally by the Command class. |
|
|
19
|
-
| [BaseChannel](/carbon/api/classes/BaseChannel) | - |
|
|
20
|
-
| [BaseCommand](/carbon/api/classes/BaseCommand) | Represents the base data of a command that the user creates |
|
|
21
|
-
| [BaseComponent](/carbon/api/classes/BaseComponent) | - |
|
|
22
|
-
| [BaseComponentInteraction](/carbon/api/classes/BaseComponentInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
23
|
-
| [BaseGuildChannel](/carbon/api/classes/BaseGuildChannel) | - |
|
|
24
|
-
| [BaseGuildTextChannel](/carbon/api/classes/BaseGuildTextChannel) | - |
|
|
25
|
-
| [BaseInteraction](/carbon/api/classes/BaseInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
26
|
-
| [Button](/carbon/api/classes/Button) | - |
|
|
27
|
-
| [ButtonInteraction](/carbon/api/classes/ButtonInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
28
|
-
| [ChannelSelectMenu](/carbon/api/classes/ChannelSelectMenu) | - |
|
|
29
|
-
| [ChannelSelectMenuInteraction](/carbon/api/classes/ChannelSelectMenuInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
30
|
-
| [Client](/carbon/api/classes/Client) | The main client used to interact with Discord |
|
|
31
|
-
| [Command](/carbon/api/classes/Command) | Represents a standard command that the user creates |
|
|
32
|
-
| [CommandHandler](/carbon/api/classes/CommandHandler) | - |
|
|
33
|
-
| [CommandInteraction](/carbon/api/classes/CommandInteraction) | Represents a command interaction |
|
|
34
|
-
| [CommandWithSubcommandGroups](/carbon/api/classes/CommandWithSubcommandGroups) | Represents a subcommand group command that the user creates. You make this instead of a [Command](/carbon/api/classes/Command) class when you want to have subcommand groups in your options. |
|
|
35
|
-
| [CommandWithSubcommands](/carbon/api/classes/CommandWithSubcommands) | Represents a subcommand command that the user creates. You make this instead of a [Command](/carbon/api/classes/Command) class when you want to have subcommands in your options. |
|
|
36
|
-
| [ComponentHandler](/carbon/api/classes/ComponentHandler) | - |
|
|
37
|
-
| [DmChannel](/carbon/api/classes/DmChannel) | Represents a DM between two users. |
|
|
38
|
-
| [GroupDmChannel](/carbon/api/classes/GroupDmChannel) | Represents a group DM channel. |
|
|
39
|
-
| [Guild](/carbon/api/classes/Guild) | - |
|
|
40
|
-
| [GuildAnnouncementChannel](/carbon/api/classes/GuildAnnouncementChannel) | Represents a guild announcement channel. |
|
|
41
|
-
| [GuildCategoryChannel](/carbon/api/classes/GuildCategoryChannel) | Represents a guild category channel. |
|
|
42
|
-
| [GuildForumChannel](/carbon/api/classes/GuildForumChannel) | Represents a guild forum channel. |
|
|
43
|
-
| [GuildMediaChannel](/carbon/api/classes/GuildMediaChannel) | Represents a guild media channel (a forum channel ) |
|
|
44
|
-
| [GuildStageChannel](/carbon/api/classes/GuildStageChannel) | - |
|
|
45
|
-
| [GuildStageOrVoiceChannel](/carbon/api/classes/GuildStageOrVoiceChannel) | - |
|
|
46
|
-
| [GuildTextChannel](/carbon/api/classes/GuildTextChannel) | - |
|
|
47
|
-
| [GuildThreadChannel](/carbon/api/classes/GuildThreadChannel) | - |
|
|
48
|
-
| [GuildThreadOnlyChannel](/carbon/api/classes/GuildThreadOnlyChannel) | - |
|
|
49
|
-
| [GuildVoiceChannel](/carbon/api/classes/GuildVoiceChannel) | - |
|
|
50
|
-
| [LinkButton](/carbon/api/classes/LinkButton) | - |
|
|
51
|
-
| [MentionableSelectMenu](/carbon/api/classes/MentionableSelectMenu) | - |
|
|
52
|
-
| [MentionableSelectMenuInteraction](/carbon/api/classes/MentionableSelectMenuInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
53
|
-
| [Message](/carbon/api/classes/Message) | - |
|
|
54
|
-
| [OptionsHandler](/carbon/api/classes/OptionsHandler) | This class is used to parse the options of a command, and provide errors for any missing or invalid options. It is used internally by the Command class. |
|
|
55
|
-
| [PremiumButton](/carbon/api/classes/PremiumButton) | - |
|
|
56
|
-
| [Role](/carbon/api/classes/Role) | - |
|
|
57
|
-
| [RoleSelectMenu](/carbon/api/classes/RoleSelectMenu) | - |
|
|
58
|
-
| [RoleSelectMenuInteraction](/carbon/api/classes/RoleSelectMenuInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
59
|
-
| [Row](/carbon/api/classes/Row) | - |
|
|
60
|
-
| [StringSelectMenu](/carbon/api/classes/StringSelectMenu) | - |
|
|
61
|
-
| [StringSelectMenuInteraction](/carbon/api/classes/StringSelectMenuInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
62
|
-
| [User](/carbon/api/classes/User) | - |
|
|
63
|
-
| [UserSelectMenu](/carbon/api/classes/UserSelectMenu) | - |
|
|
64
|
-
| [UserSelectMenuInteraction](/carbon/api/classes/UserSelectMenuInteraction) | This is the base type interaction, all interaction types extend from this |
|
|
65
|
-
|
|
66
|
-
## Type Aliases
|
|
67
|
-
|
|
68
|
-
| Type alias | Description |
|
|
69
|
-
| ------ | ------ |
|
|
70
|
-
| [AnySelectMenuComponentType](/carbon/api/type-aliases/AnySelectMenuComponentType) | - |
|
|
71
|
-
| [ClientOptions](/carbon/api/type-aliases/ClientOptions) | The options used for initializing the client |
|
|
72
|
-
| [CommandOptions](/carbon/api/type-aliases/CommandOptions) | - |
|
|
73
|
-
| [ComponentAdditionalData](/carbon/api/type-aliases/ComponentAdditionalData) | - |
|
|
74
|
-
| [InteractionFileData](/carbon/api/type-aliases/InteractionFileData) | The data for a file to send in an interaction |
|
|
75
|
-
| [InteractionReplyData](/carbon/api/type-aliases/InteractionReplyData) | The data to reply to an interaction |
|
|
76
|
-
| [InteractionReplyOptions](/carbon/api/type-aliases/InteractionReplyOptions) | Additional options for replying to an interaction |
|
|
77
|
-
| [RawOptions](/carbon/api/type-aliases/RawOptions) | - |
|
|
78
|
-
|
|
79
|
-
## Functions
|
|
80
|
-
|
|
81
|
-
| Function | Description |
|
|
82
|
-
| ------ | ------ |
|
|
83
|
-
| [channelFactory](/carbon/api/functions/channelFactory) | - |
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: ClientOptions
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> **ClientOptions**: `object`
|
|
6
|
-
|
|
7
|
-
The options used for initializing the client
|
|
8
|
-
|
|
9
|
-
## Type declaration
|
|
10
|
-
|
|
11
|
-
| Name | Type | Description |
|
|
12
|
-
| ------ | ------ | ------ |
|
|
13
|
-
| `autoDeploy` | `boolean` | Whether the commands should be deployed to Discord automatically. |
|
|
14
|
-
| `clientId` | `string` | The client ID of the bot |
|
|
15
|
-
| `mode` | [`ClientMode`](/carbon/api/enumerations/ClientMode) | The mode of the client, generally where you are hosting the bot. If you have a different mode for your local development, make sure to set it to the local one. **Example** `import { Client, ClientMode } from "@buape/carbon" const client = new Client({ clientId: "12345678901234567890", publicKey: "c1a2f941ae8ce6d776f7704d0bb3d46b863e21fda491cdb2bdba6b8bc5fe7269", token: "MTA4NjEwNTYxMDUxMDE1NTg1Nw.GNt-U8.OSHy-g-5FlfESnu3Z9MEEMJLHiRthXajiXNwiE", mode: process.env.NODE_ENV === "development" ? ClientMode.NodeJS : ClientMode.CloudflareWorkers })` |
|
|
16
|
-
| `port` | `number` | The port to run the server on, if you are using [ClientMode.Bun](/carbon/api/enumerations/ClientMode) mode. |
|
|
17
|
-
| `publicKey` | `string` | The public key of the bot, used for interaction verification |
|
|
18
|
-
| `redirectUrl` | `string` | If you want to have the root route for the interaction handler redirect to a different URL, you can set this. |
|
|
19
|
-
| `requestOptions` | `RequestClientOptions` | The options used to initialize the request client, if you want to customize it. |
|
|
20
|
-
| `token` | `string` | The token of the bot |
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: InteractionFileData
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> **InteractionFileData**: `object`
|
|
6
|
-
|
|
7
|
-
The data for a file to send in an interaction
|
|
8
|
-
|
|
9
|
-
## Type declaration
|
|
10
|
-
|
|
11
|
-
| Name | Type | Description |
|
|
12
|
-
| ------ | ------ | ------ |
|
|
13
|
-
| `data` | [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob) | The data of the file in a Blob |
|
|
14
|
-
| `description` | `string` | **`Alpha`** The alt text of the file, shown for accessibility This isn't implemented yet |
|
|
15
|
-
| `name` | `string` | The name of the file that will be given to Discord |
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: InteractionReplyData
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> **InteractionReplyData**: `object`
|
|
6
|
-
|
|
7
|
-
The data to reply to an interaction
|
|
8
|
-
|
|
9
|
-
## Type declaration
|
|
10
|
-
|
|
11
|
-
| Name | Type | Description |
|
|
12
|
-
| ------ | ------ | ------ |
|
|
13
|
-
| `components` | [`Row`](/carbon/api/classes/Row)[] | The components to send in the message, listed in rows |
|
|
14
|
-
| `content` | `string` | The content of the message |
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: InteractionReplyOptions
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
> **InteractionReplyOptions**: `object`
|
|
6
|
-
|
|
7
|
-
Additional options for replying to an interaction
|
|
8
|
-
|
|
9
|
-
## Type declaration
|
|
10
|
-
|
|
11
|
-
| Name | Type | Description |
|
|
12
|
-
| ------ | ------ | ------ |
|
|
13
|
-
| `files` | [`InteractionFileData`](/carbon/api/type-aliases/InteractionFileData)[] | The files to send in the interaction |
|
package/src/README.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Folders
|
|
2
|
-
|
|
3
|
-
`abstracts/` - Abstract classes that are used to create other classes, with inheritance in mind.
|
|
4
|
-
`classes/` - Classes that the end user will import into their application code, such as the main client.
|
|
5
|
-
`factories/` - Classes that are used to create structures from api-like data, such as the `channelFactory` function.
|
|
6
|
-
`internals/` - Classes that represent the internal structure of the framework, such as the `Base` class.
|
|
7
|
-
`structures/` - Classes that are used for api-like structures, such as the `CommandInteraction` class.
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
APIChannelSelectComponent,
|
|
3
|
-
APIMentionableSelectComponent,
|
|
4
|
-
APIRoleSelectComponent,
|
|
5
|
-
APISelectMenuComponent,
|
|
6
|
-
APIStringSelectComponent,
|
|
7
|
-
APIUserSelectComponent,
|
|
8
|
-
ComponentType
|
|
9
|
-
} from "discord-api-types/v10"
|
|
10
|
-
import type { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js"
|
|
11
|
-
import { BaseComponent } from "./BaseComponent.js"
|
|
12
|
-
|
|
13
|
-
export type AnySelectMenuComponentType =
|
|
14
|
-
| ComponentType.ChannelSelect
|
|
15
|
-
| ComponentType.RoleSelect
|
|
16
|
-
| ComponentType.StringSelect
|
|
17
|
-
| ComponentType.UserSelect
|
|
18
|
-
| ComponentType.MentionableSelect
|
|
19
|
-
|
|
20
|
-
export abstract class AnySelectMenu extends BaseComponent {
|
|
21
|
-
abstract type: AnySelectMenuComponentType
|
|
22
|
-
abstract run(interaction: AnySelectMenuInteraction): Promise<void>
|
|
23
|
-
|
|
24
|
-
minValues?: number
|
|
25
|
-
maxValues?: number
|
|
26
|
-
disabled?: boolean
|
|
27
|
-
placeholder?: string
|
|
28
|
-
|
|
29
|
-
serialize = (): APISelectMenuComponent => {
|
|
30
|
-
const options = this.serializeOptions()
|
|
31
|
-
return {
|
|
32
|
-
...options,
|
|
33
|
-
custom_id: this.customId,
|
|
34
|
-
disabled: this.disabled,
|
|
35
|
-
placeholder: this.placeholder,
|
|
36
|
-
min_values: this.minValues,
|
|
37
|
-
max_values: this.maxValues
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
abstract serializeOptions():
|
|
42
|
-
| {
|
|
43
|
-
type: ComponentType.ChannelSelect
|
|
44
|
-
channel_types: APIChannelSelectComponent["channel_types"]
|
|
45
|
-
default_values: APIChannelSelectComponent["default_values"]
|
|
46
|
-
}
|
|
47
|
-
| {
|
|
48
|
-
type: ComponentType.StringSelect
|
|
49
|
-
options: APIStringSelectComponent["options"]
|
|
50
|
-
}
|
|
51
|
-
| {
|
|
52
|
-
type: ComponentType.RoleSelect
|
|
53
|
-
default_values: APIRoleSelectComponent["default_values"]
|
|
54
|
-
}
|
|
55
|
-
| {
|
|
56
|
-
type: ComponentType.UserSelect
|
|
57
|
-
default_values: APIUserSelectComponent["default_values"]
|
|
58
|
-
}
|
|
59
|
-
| {
|
|
60
|
-
type: ComponentType.MentionableSelect
|
|
61
|
-
default_values: APIMentionableSelectComponent["default_values"]
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type APIMessageComponentSelectMenuInteraction,
|
|
3
|
-
type APIMessageSelectMenuInteractionData,
|
|
4
|
-
InteractionType
|
|
5
|
-
} from "discord-api-types/v10"
|
|
6
|
-
import type { Client } from "../classes/Client.js"
|
|
7
|
-
import { splitCustomId } from "../utils.js"
|
|
8
|
-
import { BaseComponentInteraction } from "./BaseComponentInteraction.js"
|
|
9
|
-
|
|
10
|
-
export abstract class AnySelectMenuInteraction extends BaseComponentInteraction {
|
|
11
|
-
customId: string = splitCustomId(
|
|
12
|
-
(this.rawData.data as APIMessageSelectMenuInteractionData).custom_id
|
|
13
|
-
)[0]
|
|
14
|
-
constructor(client: Client, data: APIMessageComponentSelectMenuInteraction) {
|
|
15
|
-
super(client, data)
|
|
16
|
-
if (!data.data)
|
|
17
|
-
throw new Error("Invalid interaction data was used to create this class")
|
|
18
|
-
if (data.type !== InteractionType.MessageComponent) {
|
|
19
|
-
throw new Error("Invalid interaction type was used to create this class")
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The raw IDs of the selected options (either role/string/channel IDs or the IDs you provided in your options)
|
|
25
|
-
*/
|
|
26
|
-
get values(): string[] {
|
|
27
|
-
return (this.rawData.data as APIMessageSelectMenuInteractionData).values
|
|
28
|
-
}
|
|
29
|
-
}
|
package/src/abstracts/Base.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type APIChannel,
|
|
3
|
-
type ChannelType,
|
|
4
|
-
Routes
|
|
5
|
-
} from "discord-api-types/v10"
|
|
6
|
-
import type { Client } from "../classes/Client.js"
|
|
7
|
-
import { Base } from "./Base.js"
|
|
8
|
-
|
|
9
|
-
export abstract class BaseChannel<Type extends ChannelType> extends Base {
|
|
10
|
-
/**
|
|
11
|
-
* The id of the channel.
|
|
12
|
-
*/
|
|
13
|
-
id: string
|
|
14
|
-
/**
|
|
15
|
-
* Whether the channel is a partial channel (meaning it does not have all the data).
|
|
16
|
-
* If this is true, you should use {@link BaseChannel.fetch} to get the full data of the channel.
|
|
17
|
-
*/
|
|
18
|
-
partial: boolean
|
|
19
|
-
/**
|
|
20
|
-
* The type of the channel.
|
|
21
|
-
*/
|
|
22
|
-
type?: Type
|
|
23
|
-
/**
|
|
24
|
-
* The flags of the channel in a bitfield.
|
|
25
|
-
* @see https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
|
26
|
-
*/
|
|
27
|
-
flags?: number | null
|
|
28
|
-
/**
|
|
29
|
-
* The raw data of the channel.
|
|
30
|
-
*/
|
|
31
|
-
protected rawData: Extract<APIChannel, { type: Type }> | null = null
|
|
32
|
-
|
|
33
|
-
constructor(
|
|
34
|
-
client: Client,
|
|
35
|
-
rawDataOrId: Extract<APIChannel, { type: Type }> | string
|
|
36
|
-
) {
|
|
37
|
-
super(client)
|
|
38
|
-
if (typeof rawDataOrId === "string") {
|
|
39
|
-
this.id = rawDataOrId
|
|
40
|
-
this.partial = true
|
|
41
|
-
} else {
|
|
42
|
-
this.rawData = rawDataOrId
|
|
43
|
-
this.id = rawDataOrId.id
|
|
44
|
-
this.partial = false
|
|
45
|
-
this.setData(rawDataOrId)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
protected setData(data: Extract<APIChannel, { type: Type }>) {
|
|
50
|
-
if (!data) throw new Error("Cannot set data without having data... smh")
|
|
51
|
-
this.rawData = data
|
|
52
|
-
this.type = data.type
|
|
53
|
-
this.partial = false
|
|
54
|
-
this.setSpecificData(data)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
protected abstract setSpecificData(
|
|
58
|
-
data: Extract<APIChannel, { type: Type }>
|
|
59
|
-
): void
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Fetches the channel from the API.
|
|
63
|
-
* @returns The channel data.
|
|
64
|
-
*/
|
|
65
|
-
async fetch() {
|
|
66
|
-
const newData = (await this.client.rest.get(
|
|
67
|
-
Routes.channel(this.id)
|
|
68
|
-
)) as Extract<APIChannel, { type: Type }>
|
|
69
|
-
if (!newData) throw new Error(`Channel ${this.id} not found`)
|
|
70
|
-
|
|
71
|
-
this.setData(newData)
|
|
72
|
-
}
|
|
73
|
-
}
|