@lunibee/builders 0.2.2 → 0.2.3
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/package.json +4 -1
- package/src/attachment.ts +3 -3
- package/src/commands.ts +57 -47
- package/src/components.ts +45 -45
- package/src/embed.ts +3 -3
- package/src/index.ts +2 -1
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunibee/builders",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./src/index.ts"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@lunibee/types": "^0.2.3"
|
|
9
12
|
}
|
|
10
13
|
}
|
package/src/attachment.ts
CHANGED
|
@@ -69,11 +69,11 @@ export class CreateAttachment {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
// ─── Deprecated names (0.2.2), removed in
|
|
72
|
+
// ─── Deprecated names (0.2.2), removed in 0.3.0 ────────────────────────────────
|
|
73
73
|
// Builders are now `CreateX` (`ButtonBuilder` → `CreateButton`); `…Style` became
|
|
74
74
|
// `…Type` and `…Type` became `…Enum`.
|
|
75
75
|
|
|
76
|
-
/** @deprecated Use {@link CreateAttachment}. Removed in
|
|
76
|
+
/** @deprecated Use {@link CreateAttachment}. Removed in 0.3.0. */
|
|
77
77
|
export const AttachmentBuilder = CreateAttachment;
|
|
78
|
-
/** @deprecated Use {@link CreateAttachment}. Removed in
|
|
78
|
+
/** @deprecated Use {@link CreateAttachment}. Removed in 0.3.0. */
|
|
79
79
|
export type AttachmentBuilder = CreateAttachment;
|
package/src/commands.ts
CHANGED
|
@@ -16,6 +16,16 @@ export const ApplicationCommandOptionEnum = {
|
|
|
16
16
|
export type ApplicationCommandOptionEnum =
|
|
17
17
|
(typeof ApplicationCommandOptionEnum)[keyof typeof ApplicationCommandOptionEnum];
|
|
18
18
|
|
|
19
|
+
/** Throws unless every context is 0 (guilds), 1 (the bot's DMs) or 2 (other DMs). */
|
|
20
|
+
function validateContexts(contexts: number[]): void {
|
|
21
|
+
if (
|
|
22
|
+
contexts.some(
|
|
23
|
+
(context) => context !== 0 && context !== 1 && context !== 2,
|
|
24
|
+
)
|
|
25
|
+
)
|
|
26
|
+
throw new RangeError("Command contexts must be 0, 1 or 2.");
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
/** Builds Discord application command payloads. */
|
|
20
30
|
export class CreateSlashCommand {
|
|
21
31
|
readonly #data: Record<string, unknown> = { type: 1 };
|
|
@@ -31,9 +41,14 @@ export class CreateSlashCommand {
|
|
|
31
41
|
this.#data.description = description;
|
|
32
42
|
return this;
|
|
33
43
|
}
|
|
34
|
-
/** Sets
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
/** Sets where the command can be used: 0 guilds, 1 the bot's DMs, 2 other DMs. @throws {RangeError} For any other value. */
|
|
45
|
+
public setContexts(...contexts: number[]): this {
|
|
46
|
+
validateContexts(contexts);
|
|
47
|
+
this.#data.contexts = [...contexts];
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
/** @deprecated Discord deprecated `dm_permission`. Use {@link CreateSlashCommand.setContexts}: `setContexts(0)` for guilds only, `setContexts(0, 1)` to allow the bot's DMs. Removed in 0.3.0. */
|
|
51
|
+
public setDMPermission(enabled: boolean): this {
|
|
37
52
|
this.#data.dm_permission = enabled;
|
|
38
53
|
return this;
|
|
39
54
|
}
|
|
@@ -269,7 +284,7 @@ export class CreateIntegerOption extends CreateCommandOption {
|
|
|
269
284
|
this.data.max_value = value;
|
|
270
285
|
return this;
|
|
271
286
|
}
|
|
272
|
-
public setAutocomplete(enabled = true): this {
|
|
287
|
+
public override setAutocomplete(enabled = true): this {
|
|
273
288
|
if (
|
|
274
289
|
enabled &&
|
|
275
290
|
Array.isArray(this.data.choices) &&
|
|
@@ -325,7 +340,7 @@ export class CreateNumberOption extends CreateCommandOption {
|
|
|
325
340
|
this.data.max_value = value;
|
|
326
341
|
return this;
|
|
327
342
|
}
|
|
328
|
-
public setAutocomplete(enabled = true): this {
|
|
343
|
+
public override setAutocomplete(enabled = true): this {
|
|
329
344
|
if (
|
|
330
345
|
enabled &&
|
|
331
346
|
Array.isArray(this.data.choices) &&
|
|
@@ -591,7 +606,7 @@ export class CreateContextMenuCommand {
|
|
|
591
606
|
permissions === null ? null : BigInt(permissions).toString();
|
|
592
607
|
return this;
|
|
593
608
|
}
|
|
594
|
-
/**
|
|
609
|
+
/** @deprecated Discord deprecated `dm_permission`. Use {@link CreateContextMenuCommand.setContexts}: `setContexts(0)` for guilds only, `setContexts(0, 1)` to allow the bot's DMs. Removed in 0.3.0. */
|
|
595
610
|
public setDMPermission(enabled: boolean): this {
|
|
596
611
|
this.data.dm_permission = enabled;
|
|
597
612
|
return this;
|
|
@@ -603,12 +618,7 @@ export class CreateContextMenuCommand {
|
|
|
603
618
|
}
|
|
604
619
|
/** Sets where the command can be used: 0 guilds, 1 the bot's DMs, 2 other DMs. @throws {RangeError} For any other value. */
|
|
605
620
|
public setContexts(...contexts: number[]): this {
|
|
606
|
-
|
|
607
|
-
contexts.some(
|
|
608
|
-
(context) => context !== 0 && context !== 1 && context !== 2,
|
|
609
|
-
)
|
|
610
|
-
)
|
|
611
|
-
throw new RangeError("Command contexts must be 0, 1 or 2.");
|
|
621
|
+
validateContexts(contexts);
|
|
612
622
|
this.data.contexts = [...contexts];
|
|
613
623
|
return this;
|
|
614
624
|
}
|
|
@@ -646,91 +656,91 @@ export class CreateMessageCommand extends CreateContextMenuCommand {
|
|
|
646
656
|
}
|
|
647
657
|
}
|
|
648
658
|
|
|
649
|
-
// ─── Deprecated names (0.2.2), removed in
|
|
659
|
+
// ─── Deprecated names (0.2.2), removed in 0.3.0 ────────────────────────────────
|
|
650
660
|
// Builders are now `CreateX` (`ButtonBuilder` → `CreateButton`); `…Style` became
|
|
651
661
|
// `…Type` and `…Type` became `…Enum`.
|
|
652
662
|
|
|
653
|
-
/** @deprecated Use {@link CreateAttachmentOption}. Removed in
|
|
663
|
+
/** @deprecated Use {@link CreateAttachmentOption}. Removed in 0.3.0. */
|
|
654
664
|
export const AttachmentOptionBuilder = CreateAttachmentOption;
|
|
655
|
-
/** @deprecated Use {@link CreateAttachmentOption}. Removed in
|
|
665
|
+
/** @deprecated Use {@link CreateAttachmentOption}. Removed in 0.3.0. */
|
|
656
666
|
export type AttachmentOptionBuilder = CreateAttachmentOption;
|
|
657
667
|
|
|
658
|
-
/** @deprecated Use {@link CreateBooleanOption}. Removed in
|
|
668
|
+
/** @deprecated Use {@link CreateBooleanOption}. Removed in 0.3.0. */
|
|
659
669
|
export const BooleanOptionBuilder = CreateBooleanOption;
|
|
660
|
-
/** @deprecated Use {@link CreateBooleanOption}. Removed in
|
|
670
|
+
/** @deprecated Use {@link CreateBooleanOption}. Removed in 0.3.0. */
|
|
661
671
|
export type BooleanOptionBuilder = CreateBooleanOption;
|
|
662
672
|
|
|
663
|
-
/** @deprecated Use {@link CreateChannelOption}. Removed in
|
|
673
|
+
/** @deprecated Use {@link CreateChannelOption}. Removed in 0.3.0. */
|
|
664
674
|
export const ChannelOptionBuilder = CreateChannelOption;
|
|
665
|
-
/** @deprecated Use {@link CreateChannelOption}. Removed in
|
|
675
|
+
/** @deprecated Use {@link CreateChannelOption}. Removed in 0.3.0. */
|
|
666
676
|
export type ChannelOptionBuilder = CreateChannelOption;
|
|
667
677
|
|
|
668
|
-
/** @deprecated Use {@link CreateCommandOption}. Removed in
|
|
678
|
+
/** @deprecated Use {@link CreateCommandOption}. Removed in 0.3.0. */
|
|
669
679
|
export const CommandOptionBuilder = CreateCommandOption;
|
|
670
|
-
/** @deprecated Use {@link CreateCommandOption}. Removed in
|
|
680
|
+
/** @deprecated Use {@link CreateCommandOption}. Removed in 0.3.0. */
|
|
671
681
|
export type CommandOptionBuilder = CreateCommandOption;
|
|
672
682
|
|
|
673
|
-
/** @deprecated Use {@link CreateContextMenuCommand}. Removed in
|
|
683
|
+
/** @deprecated Use {@link CreateContextMenuCommand}. Removed in 0.3.0. */
|
|
674
684
|
export const ContextMenuCommandBuilder = CreateContextMenuCommand;
|
|
675
|
-
/** @deprecated Use {@link CreateContextMenuCommand}. Removed in
|
|
685
|
+
/** @deprecated Use {@link CreateContextMenuCommand}. Removed in 0.3.0. */
|
|
676
686
|
export type ContextMenuCommandBuilder = CreateContextMenuCommand;
|
|
677
687
|
|
|
678
|
-
/** @deprecated Use {@link CreateIntegerOption}. Removed in
|
|
688
|
+
/** @deprecated Use {@link CreateIntegerOption}. Removed in 0.3.0. */
|
|
679
689
|
export const IntegerOptionBuilder = CreateIntegerOption;
|
|
680
|
-
/** @deprecated Use {@link CreateIntegerOption}. Removed in
|
|
690
|
+
/** @deprecated Use {@link CreateIntegerOption}. Removed in 0.3.0. */
|
|
681
691
|
export type IntegerOptionBuilder = CreateIntegerOption;
|
|
682
692
|
|
|
683
|
-
/** @deprecated Use {@link CreateMentionableOption}. Removed in
|
|
693
|
+
/** @deprecated Use {@link CreateMentionableOption}. Removed in 0.3.0. */
|
|
684
694
|
export const MentionableOptionBuilder = CreateMentionableOption;
|
|
685
|
-
/** @deprecated Use {@link CreateMentionableOption}. Removed in
|
|
695
|
+
/** @deprecated Use {@link CreateMentionableOption}. Removed in 0.3.0. */
|
|
686
696
|
export type MentionableOptionBuilder = CreateMentionableOption;
|
|
687
697
|
|
|
688
|
-
/** @deprecated Use {@link CreateMessageCommand}. Removed in
|
|
698
|
+
/** @deprecated Use {@link CreateMessageCommand}. Removed in 0.3.0. */
|
|
689
699
|
export const MessageCommandBuilder = CreateMessageCommand;
|
|
690
|
-
/** @deprecated Use {@link CreateMessageCommand}. Removed in
|
|
700
|
+
/** @deprecated Use {@link CreateMessageCommand}. Removed in 0.3.0. */
|
|
691
701
|
export type MessageCommandBuilder = CreateMessageCommand;
|
|
692
702
|
|
|
693
|
-
/** @deprecated Use {@link CreateNumberOption}. Removed in
|
|
703
|
+
/** @deprecated Use {@link CreateNumberOption}. Removed in 0.3.0. */
|
|
694
704
|
export const NumberOptionBuilder = CreateNumberOption;
|
|
695
|
-
/** @deprecated Use {@link CreateNumberOption}. Removed in
|
|
705
|
+
/** @deprecated Use {@link CreateNumberOption}. Removed in 0.3.0. */
|
|
696
706
|
export type NumberOptionBuilder = CreateNumberOption;
|
|
697
707
|
|
|
698
|
-
/** @deprecated Use {@link CreateRoleOption}. Removed in
|
|
708
|
+
/** @deprecated Use {@link CreateRoleOption}. Removed in 0.3.0. */
|
|
699
709
|
export const RoleOptionBuilder = CreateRoleOption;
|
|
700
|
-
/** @deprecated Use {@link CreateRoleOption}. Removed in
|
|
710
|
+
/** @deprecated Use {@link CreateRoleOption}. Removed in 0.3.0. */
|
|
701
711
|
export type RoleOptionBuilder = CreateRoleOption;
|
|
702
712
|
|
|
703
|
-
/** @deprecated Use {@link CreateSlashCommand}. Removed in
|
|
713
|
+
/** @deprecated Use {@link CreateSlashCommand}. Removed in 0.3.0. */
|
|
704
714
|
export const SlashCommandBuilder = CreateSlashCommand;
|
|
705
|
-
/** @deprecated Use {@link CreateSlashCommand}. Removed in
|
|
715
|
+
/** @deprecated Use {@link CreateSlashCommand}. Removed in 0.3.0. */
|
|
706
716
|
export type SlashCommandBuilder = CreateSlashCommand;
|
|
707
717
|
|
|
708
|
-
/** @deprecated Use {@link CreateStringOption}. Removed in
|
|
718
|
+
/** @deprecated Use {@link CreateStringOption}. Removed in 0.3.0. */
|
|
709
719
|
export const StringOptionBuilder = CreateStringOption;
|
|
710
|
-
/** @deprecated Use {@link CreateStringOption}. Removed in
|
|
720
|
+
/** @deprecated Use {@link CreateStringOption}. Removed in 0.3.0. */
|
|
711
721
|
export type StringOptionBuilder = CreateStringOption;
|
|
712
722
|
|
|
713
|
-
/** @deprecated Use {@link CreateSubcommand}. Removed in
|
|
723
|
+
/** @deprecated Use {@link CreateSubcommand}. Removed in 0.3.0. */
|
|
714
724
|
export const SubcommandBuilder = CreateSubcommand;
|
|
715
|
-
/** @deprecated Use {@link CreateSubcommand}. Removed in
|
|
725
|
+
/** @deprecated Use {@link CreateSubcommand}. Removed in 0.3.0. */
|
|
716
726
|
export type SubcommandBuilder = CreateSubcommand;
|
|
717
727
|
|
|
718
|
-
/** @deprecated Use {@link CreateSubcommandGroup}. Removed in
|
|
728
|
+
/** @deprecated Use {@link CreateSubcommandGroup}. Removed in 0.3.0. */
|
|
719
729
|
export const SubcommandGroupBuilder = CreateSubcommandGroup;
|
|
720
|
-
/** @deprecated Use {@link CreateSubcommandGroup}. Removed in
|
|
730
|
+
/** @deprecated Use {@link CreateSubcommandGroup}. Removed in 0.3.0. */
|
|
721
731
|
export type SubcommandGroupBuilder = CreateSubcommandGroup;
|
|
722
732
|
|
|
723
|
-
/** @deprecated Use {@link CreateUserCommand}. Removed in
|
|
733
|
+
/** @deprecated Use {@link CreateUserCommand}. Removed in 0.3.0. */
|
|
724
734
|
export const UserCommandBuilder = CreateUserCommand;
|
|
725
|
-
/** @deprecated Use {@link CreateUserCommand}. Removed in
|
|
735
|
+
/** @deprecated Use {@link CreateUserCommand}. Removed in 0.3.0. */
|
|
726
736
|
export type UserCommandBuilder = CreateUserCommand;
|
|
727
737
|
|
|
728
|
-
/** @deprecated Use {@link CreateUserOption}. Removed in
|
|
738
|
+
/** @deprecated Use {@link CreateUserOption}. Removed in 0.3.0. */
|
|
729
739
|
export const UserOptionBuilder = CreateUserOption;
|
|
730
|
-
/** @deprecated Use {@link CreateUserOption}. Removed in
|
|
740
|
+
/** @deprecated Use {@link CreateUserOption}. Removed in 0.3.0. */
|
|
731
741
|
export type UserOptionBuilder = CreateUserOption;
|
|
732
742
|
|
|
733
|
-
/** @deprecated Use {@link ApplicationCommandOptionEnum}. Removed in
|
|
743
|
+
/** @deprecated Use {@link ApplicationCommandOptionEnum}. Removed in 0.3.0. */
|
|
734
744
|
export const ApplicationCommandOptionType = ApplicationCommandOptionEnum;
|
|
735
|
-
/** @deprecated Use {@link ApplicationCommandOptionEnum}. Removed in
|
|
745
|
+
/** @deprecated Use {@link ApplicationCommandOptionEnum}. Removed in 0.3.0. */
|
|
736
746
|
export type ApplicationCommandOptionType = ApplicationCommandOptionEnum;
|
package/src/components.ts
CHANGED
|
@@ -798,118 +798,118 @@ export function componentsV2Message<
|
|
|
798
798
|
};
|
|
799
799
|
}
|
|
800
800
|
|
|
801
|
-
// ─── Deprecated names (0.2.2), removed in
|
|
801
|
+
// ─── Deprecated names (0.2.2), removed in 0.3.0 ────────────────────────────────
|
|
802
802
|
// Builders are now `CreateX` (`ButtonBuilder` → `CreateButton`); `…Style` became
|
|
803
803
|
// `…Type` and `…Type` became `…Enum`.
|
|
804
804
|
|
|
805
|
-
/** @deprecated Use {@link CreateButton}. Removed in
|
|
805
|
+
/** @deprecated Use {@link CreateButton}. Removed in 0.3.0. */
|
|
806
806
|
export const ButtonBuilder = CreateButton;
|
|
807
|
-
/** @deprecated Use {@link CreateButton}. Removed in
|
|
807
|
+
/** @deprecated Use {@link CreateButton}. Removed in 0.3.0. */
|
|
808
808
|
export type ButtonBuilder = CreateButton;
|
|
809
809
|
|
|
810
|
-
/** @deprecated Use {@link CreateChannelSelectMenu}. Removed in
|
|
810
|
+
/** @deprecated Use {@link CreateChannelSelectMenu}. Removed in 0.3.0. */
|
|
811
811
|
export const ChannelSelectMenuBuilder = CreateChannelSelectMenu;
|
|
812
|
-
/** @deprecated Use {@link CreateChannelSelectMenu}. Removed in
|
|
812
|
+
/** @deprecated Use {@link CreateChannelSelectMenu}. Removed in 0.3.0. */
|
|
813
813
|
export type ChannelSelectMenuBuilder = CreateChannelSelectMenu;
|
|
814
814
|
|
|
815
|
-
/** @deprecated Use {@link CreateContainer}. Removed in
|
|
815
|
+
/** @deprecated Use {@link CreateContainer}. Removed in 0.3.0. */
|
|
816
816
|
export const ContainerBuilder = CreateContainer;
|
|
817
|
-
/** @deprecated Use {@link CreateContainer}. Removed in
|
|
817
|
+
/** @deprecated Use {@link CreateContainer}. Removed in 0.3.0. */
|
|
818
818
|
export type ContainerBuilder = CreateContainer;
|
|
819
819
|
|
|
820
|
-
/** @deprecated Use {@link CreateContentInventoryEntry}. Removed in
|
|
820
|
+
/** @deprecated Use {@link CreateContentInventoryEntry}. Removed in 0.3.0. */
|
|
821
821
|
export const ContentInventoryEntryBuilder = CreateContentInventoryEntry;
|
|
822
|
-
/** @deprecated Use {@link CreateContentInventoryEntry}. Removed in
|
|
822
|
+
/** @deprecated Use {@link CreateContentInventoryEntry}. Removed in 0.3.0. */
|
|
823
823
|
export type ContentInventoryEntryBuilder = CreateContentInventoryEntry;
|
|
824
824
|
|
|
825
|
-
/** @deprecated Use {@link CreateEntitySelect}. Removed in
|
|
825
|
+
/** @deprecated Use {@link CreateEntitySelect}. Removed in 0.3.0. */
|
|
826
826
|
export const EntitySelectBuilder = CreateEntitySelect;
|
|
827
|
-
/** @deprecated Use {@link CreateEntitySelect}. Removed in
|
|
827
|
+
/** @deprecated Use {@link CreateEntitySelect}. Removed in 0.3.0. */
|
|
828
828
|
export type EntitySelectBuilder = CreateEntitySelect;
|
|
829
829
|
|
|
830
|
-
/** @deprecated Use {@link CreateFileComponent}. Removed in
|
|
830
|
+
/** @deprecated Use {@link CreateFileComponent}. Removed in 0.3.0. */
|
|
831
831
|
export const FileComponentBuilder = CreateFileComponent;
|
|
832
|
-
/** @deprecated Use {@link CreateFileComponent}. Removed in
|
|
832
|
+
/** @deprecated Use {@link CreateFileComponent}. Removed in 0.3.0. */
|
|
833
833
|
export type FileComponentBuilder = CreateFileComponent;
|
|
834
834
|
|
|
835
|
-
/** @deprecated Use {@link CreateMediaGallery}. Removed in
|
|
835
|
+
/** @deprecated Use {@link CreateMediaGallery}. Removed in 0.3.0. */
|
|
836
836
|
export const MediaGalleryBuilder = CreateMediaGallery;
|
|
837
|
-
/** @deprecated Use {@link CreateMediaGallery}. Removed in
|
|
837
|
+
/** @deprecated Use {@link CreateMediaGallery}. Removed in 0.3.0. */
|
|
838
838
|
export type MediaGalleryBuilder = CreateMediaGallery;
|
|
839
839
|
|
|
840
|
-
/** @deprecated Use {@link CreateMentionableSelectMenu}. Removed in
|
|
840
|
+
/** @deprecated Use {@link CreateMentionableSelectMenu}. Removed in 0.3.0. */
|
|
841
841
|
export const MentionableSelectMenuBuilder = CreateMentionableSelectMenu;
|
|
842
|
-
/** @deprecated Use {@link CreateMentionableSelectMenu}. Removed in
|
|
842
|
+
/** @deprecated Use {@link CreateMentionableSelectMenu}. Removed in 0.3.0. */
|
|
843
843
|
export type MentionableSelectMenuBuilder = CreateMentionableSelectMenu;
|
|
844
844
|
|
|
845
|
-
/** @deprecated Use {@link CreateModal}. Removed in
|
|
845
|
+
/** @deprecated Use {@link CreateModal}. Removed in 0.3.0. */
|
|
846
846
|
export const ModalBuilder = CreateModal;
|
|
847
|
-
/** @deprecated Use {@link CreateModal}. Removed in
|
|
847
|
+
/** @deprecated Use {@link CreateModal}. Removed in 0.3.0. */
|
|
848
848
|
export type ModalBuilder = CreateModal;
|
|
849
849
|
|
|
850
|
-
/** @deprecated Use {@link CreateRoleSelectMenu}. Removed in
|
|
850
|
+
/** @deprecated Use {@link CreateRoleSelectMenu}. Removed in 0.3.0. */
|
|
851
851
|
export const RoleSelectMenuBuilder = CreateRoleSelectMenu;
|
|
852
|
-
/** @deprecated Use {@link CreateRoleSelectMenu}. Removed in
|
|
852
|
+
/** @deprecated Use {@link CreateRoleSelectMenu}. Removed in 0.3.0. */
|
|
853
853
|
export type RoleSelectMenuBuilder = CreateRoleSelectMenu;
|
|
854
854
|
|
|
855
|
-
/** @deprecated Use {@link CreateSection}. Removed in
|
|
855
|
+
/** @deprecated Use {@link CreateSection}. Removed in 0.3.0. */
|
|
856
856
|
export const SectionBuilder = CreateSection;
|
|
857
|
-
/** @deprecated Use {@link CreateSection}. Removed in
|
|
857
|
+
/** @deprecated Use {@link CreateSection}. Removed in 0.3.0. */
|
|
858
858
|
export type SectionBuilder = CreateSection;
|
|
859
859
|
|
|
860
|
-
/** @deprecated Use {@link CreateSeparator}. Removed in
|
|
860
|
+
/** @deprecated Use {@link CreateSeparator}. Removed in 0.3.0. */
|
|
861
861
|
export const SeparatorBuilder = CreateSeparator;
|
|
862
|
-
/** @deprecated Use {@link CreateSeparator}. Removed in
|
|
862
|
+
/** @deprecated Use {@link CreateSeparator}. Removed in 0.3.0. */
|
|
863
863
|
export type SeparatorBuilder = CreateSeparator;
|
|
864
864
|
|
|
865
|
-
/** @deprecated Use {@link CreateStringSelect}. Removed in
|
|
865
|
+
/** @deprecated Use {@link CreateStringSelect}. Removed in 0.3.0. */
|
|
866
866
|
export const StringSelectBuilder = CreateStringSelect;
|
|
867
|
-
/** @deprecated Use {@link CreateStringSelect}. Removed in
|
|
867
|
+
/** @deprecated Use {@link CreateStringSelect}. Removed in 0.3.0. */
|
|
868
868
|
export type StringSelectBuilder = CreateStringSelect;
|
|
869
869
|
|
|
870
|
-
/** @deprecated Use {@link CreateStringSelectMenu}. Removed in
|
|
870
|
+
/** @deprecated Use {@link CreateStringSelectMenu}. Removed in 0.3.0. */
|
|
871
871
|
export const StringSelectMenuBuilder = CreateStringSelect;
|
|
872
|
-
/** @deprecated Use {@link CreateStringSelectMenu}. Removed in
|
|
872
|
+
/** @deprecated Use {@link CreateStringSelectMenu}. Removed in 0.3.0. */
|
|
873
873
|
export type StringSelectMenuBuilder = CreateStringSelect;
|
|
874
874
|
|
|
875
|
-
/** @deprecated Use {@link CreateTextDisplay}. Removed in
|
|
875
|
+
/** @deprecated Use {@link CreateTextDisplay}. Removed in 0.3.0. */
|
|
876
876
|
export const TextDisplayBuilder = CreateTextDisplay;
|
|
877
|
-
/** @deprecated Use {@link CreateTextDisplay}. Removed in
|
|
877
|
+
/** @deprecated Use {@link CreateTextDisplay}. Removed in 0.3.0. */
|
|
878
878
|
export type TextDisplayBuilder = CreateTextDisplay;
|
|
879
879
|
|
|
880
|
-
/** @deprecated Use {@link CreateTextInput}. Removed in
|
|
880
|
+
/** @deprecated Use {@link CreateTextInput}. Removed in 0.3.0. */
|
|
881
881
|
export const TextInputBuilder = CreateTextInput;
|
|
882
|
-
/** @deprecated Use {@link CreateTextInput}. Removed in
|
|
882
|
+
/** @deprecated Use {@link CreateTextInput}. Removed in 0.3.0. */
|
|
883
883
|
export type TextInputBuilder = CreateTextInput;
|
|
884
884
|
|
|
885
|
-
/** @deprecated Use {@link CreateThumbnail}. Removed in
|
|
885
|
+
/** @deprecated Use {@link CreateThumbnail}. Removed in 0.3.0. */
|
|
886
886
|
export const ThumbnailBuilder = CreateThumbnail;
|
|
887
|
-
/** @deprecated Use {@link CreateThumbnail}. Removed in
|
|
887
|
+
/** @deprecated Use {@link CreateThumbnail}. Removed in 0.3.0. */
|
|
888
888
|
export type ThumbnailBuilder = CreateThumbnail;
|
|
889
889
|
|
|
890
|
-
/** @deprecated Use {@link CreateUserSelectMenu}. Removed in
|
|
890
|
+
/** @deprecated Use {@link CreateUserSelectMenu}. Removed in 0.3.0. */
|
|
891
891
|
export const UserSelectMenuBuilder = CreateUserSelectMenu;
|
|
892
|
-
/** @deprecated Use {@link CreateUserSelectMenu}. Removed in
|
|
892
|
+
/** @deprecated Use {@link CreateUserSelectMenu}. Removed in 0.3.0. */
|
|
893
893
|
export type UserSelectMenuBuilder = CreateUserSelectMenu;
|
|
894
894
|
|
|
895
|
-
/** @deprecated Use {@link CreateActionRow}. Removed in
|
|
895
|
+
/** @deprecated Use {@link CreateActionRow}. Removed in 0.3.0. */
|
|
896
896
|
export const ActionRowBuilder = CreateActionRow;
|
|
897
|
-
/** @deprecated Use {@link CreateActionRow}. Removed in
|
|
897
|
+
/** @deprecated Use {@link CreateActionRow}. Removed in 0.3.0. */
|
|
898
898
|
export type ActionRowBuilder<
|
|
899
899
|
T extends { toJSON(): APIActionRowChild } = { toJSON(): APIActionRowChild },
|
|
900
900
|
> = CreateActionRow<T>;
|
|
901
901
|
|
|
902
|
-
/** @deprecated Use {@link ButtonType}. Removed in
|
|
902
|
+
/** @deprecated Use {@link ButtonType}. Removed in 0.3.0. */
|
|
903
903
|
export const ButtonStyle = ButtonType;
|
|
904
|
-
/** @deprecated Use {@link ButtonType}. Removed in
|
|
904
|
+
/** @deprecated Use {@link ButtonType}. Removed in 0.3.0. */
|
|
905
905
|
export type ButtonStyle = ButtonType;
|
|
906
906
|
|
|
907
|
-
/** @deprecated Use {@link TextInputType}. Removed in
|
|
907
|
+
/** @deprecated Use {@link TextInputType}. Removed in 0.3.0. */
|
|
908
908
|
export const TextInputStyle = TextInputType;
|
|
909
|
-
/** @deprecated Use {@link TextInputType}. Removed in
|
|
909
|
+
/** @deprecated Use {@link TextInputType}. Removed in 0.3.0. */
|
|
910
910
|
export type TextInputStyle = TextInputType;
|
|
911
911
|
|
|
912
|
-
/** @deprecated Use {@link ComponentEnum}. Removed in
|
|
912
|
+
/** @deprecated Use {@link ComponentEnum}. Removed in 0.3.0. */
|
|
913
913
|
export const ComponentType = ComponentEnum;
|
|
914
|
-
/** @deprecated Use {@link ComponentEnum}. Removed in
|
|
914
|
+
/** @deprecated Use {@link ComponentEnum}. Removed in 0.3.0. */
|
|
915
915
|
export type ComponentType = ComponentEnum;
|
package/src/embed.ts
CHANGED
|
@@ -204,11 +204,11 @@ function url(value: string, field: string): string {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
// ─── Deprecated names (0.2.2), removed in
|
|
207
|
+
// ─── Deprecated names (0.2.2), removed in 0.3.0 ────────────────────────────────
|
|
208
208
|
// Builders are now `CreateX` (`ButtonBuilder` → `CreateButton`); `…Style` became
|
|
209
209
|
// `…Type` and `…Type` became `…Enum`.
|
|
210
210
|
|
|
211
|
-
/** @deprecated Use {@link CreateEmbed}. Removed in
|
|
211
|
+
/** @deprecated Use {@link CreateEmbed}. Removed in 0.3.0. */
|
|
212
212
|
export const EmbedBuilder = CreateEmbed;
|
|
213
|
-
/** @deprecated Use {@link CreateEmbed}. Removed in
|
|
213
|
+
/** @deprecated Use {@link CreateEmbed}. Removed in 0.3.0. */
|
|
214
214
|
export type EmbedBuilder = CreateEmbed;
|
package/src/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ export {
|
|
|
27
27
|
} from "./components.js";
|
|
28
28
|
export {
|
|
29
29
|
CreateSlashCommand,
|
|
30
|
+
CreateCommandOption,
|
|
30
31
|
CreateStringOption,
|
|
31
32
|
CreateIntegerOption,
|
|
32
33
|
CreateNumberOption,
|
|
@@ -45,7 +46,7 @@ export {
|
|
|
45
46
|
} from "./commands.js";
|
|
46
47
|
export { CreateAttachment, type AttachmentData } from "./attachment.js";
|
|
47
48
|
|
|
48
|
-
// Deprecated names (0.2.2), removed in
|
|
49
|
+
// Deprecated names (0.2.2), removed in 0.3.0.
|
|
49
50
|
export { AttachmentBuilder } from "./attachment.js";
|
|
50
51
|
export { EmbedBuilder } from "./embed.js";
|
|
51
52
|
export {
|