@mostfeatured/dbi 0.2.16 → 0.2.18
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/src/types/Components/HTMLComponentsV2/index.d.ts +4 -0
- package/dist/src/types/Components/HTMLComponentsV2/index.d.ts.map +1 -1
- package/dist/src/types/Components/HTMLComponentsV2/index.js +40 -5
- package/dist/src/types/Components/HTMLComponentsV2/index.js.map +1 -1
- package/dist/src/types/Event.d.ts +21 -13
- package/dist/src/types/Event.d.ts.map +1 -1
- package/dist/src/types/Event.js.map +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/generated/namespaceData.d.ts +3 -1
- package/package.json +6 -2
- package/.gitattributes +0 -2
- package/.hintrc +0 -8
- package/.vscode/settings.json +0 -3
- package/docs/ADVANCED_FEATURES.md +0 -840
- package/docs/API_REFERENCE.md +0 -929
- package/docs/CHAT_INPUT.md +0 -811
- package/docs/COMPONENTS.md +0 -1039
- package/docs/EVENTS.md +0 -568
- package/docs/GETTING_STARTED.md +0 -398
- package/docs/LOCALIZATION.md +0 -777
- package/docs/README.md +0 -345
- package/docs/SVELTE_COMPONENTS.md +0 -1111
- package/docs/llm/ADVANCED_FEATURES.txt +0 -521
- package/docs/llm/API_REFERENCE.txt +0 -659
- package/docs/llm/CHAT_INPUT.txt +0 -514
- package/docs/llm/COMPONENTS.txt +0 -595
- package/docs/llm/EVENTS.txt +0 -449
- package/docs/llm/GETTING_STARTED.txt +0 -296
- package/docs/llm/LOCALIZATION.txt +0 -501
- package/docs/llm/README.txt +0 -193
- package/docs/llm/SVELTE_COMPONENTS.txt +0 -566
- package/src/DBI.ts +0 -1007
- package/src/Events.ts +0 -189
- package/src/data/eventMap.json +0 -248
- package/src/index.ts +0 -23
- package/src/methods/handleMessageCommands.ts +0 -482
- package/src/methods/hookEventListeners.ts +0 -119
- package/src/methods/hookInteractionListeners.ts +0 -314
- package/src/methods/publishInteractions.ts +0 -256
- package/src/types/ApplicationRoleConnectionMetadata.ts +0 -19
- package/src/types/Builders/ButtonBuilder.ts +0 -53
- package/src/types/Builders/ChannelSelectMenuBuilder.ts +0 -53
- package/src/types/Builders/MentionableSelectMenuBuilder.ts +0 -53
- package/src/types/Builders/ModalBuilder.ts +0 -53
- package/src/types/Builders/RoleSelectMenuBuilder.ts +0 -53
- package/src/types/Builders/StringSelectMenuBuilder.ts +0 -53
- package/src/types/Builders/UserSelectMenuBuilder.ts +0 -53
- package/src/types/ChatInput/ChatInput.ts +0 -28
- package/src/types/ChatInput/ChatInputOptions.ts +0 -388
- package/src/types/Components/Button.ts +0 -39
- package/src/types/Components/ChannelSelectMenu.ts +0 -43
- package/src/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.ts +0 -78
- package/src/types/Components/HTMLComponentsV2/index.ts +0 -761
- package/src/types/Components/HTMLComponentsV2/parser.ts +0 -649
- package/src/types/Components/HTMLComponentsV2/svelteParser.ts +0 -1503
- package/src/types/Components/HTMLComponentsV2/svelteRenderer.ts +0 -416
- package/src/types/Components/MentionableSelectMenu.ts +0 -43
- package/src/types/Components/Modal.ts +0 -46
- package/src/types/Components/RoleSelectMenu.ts +0 -43
- package/src/types/Components/StringSelectMenu.ts +0 -43
- package/src/types/Components/UserSelectMenu.ts +0 -43
- package/src/types/Event.ts +0 -145
- package/src/types/Interaction.ts +0 -100
- package/src/types/other/CustomEvent.ts +0 -19
- package/src/types/other/FakeMessageInteraction.ts +0 -408
- package/src/types/other/InteractionLocale.ts +0 -34
- package/src/types/other/Locale.ts +0 -70
- package/src/types/other/MessageContextMenu.ts +0 -27
- package/src/types/other/UserContextMenu.ts +0 -25
- package/src/utils/MemoryStore.ts +0 -28
- package/src/utils/UtilTypes.ts +0 -11
- package/src/utils/customId.ts +0 -49
- package/src/utils/permissions.ts +0 -5
- package/src/utils/recursiveImport.ts +0 -35
- package/src/utils/recursiveUnload.ts +0 -25
- package/src/utils/unloadModule.ts +0 -7
- package/test/index.ts +0 -176
- package/test/product-showcase.svelte +0 -558
- package/test/test.ts +0 -3
- package/tsconfig.json +0 -51
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import Discord from "discord.js";
|
|
2
|
-
import { DBI } from "../../DBI";
|
|
3
|
-
import { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from "../Interaction";
|
|
4
|
-
import { buildCustomId } from "../../utils/customId";
|
|
5
|
-
import { IDBIToJSONArgs } from "../../utils/UtilTypes";
|
|
6
|
-
import { NamespaceEnums } from "../../../generated/namespaceData";
|
|
7
|
-
import stuffs from "stuffs";
|
|
8
|
-
import { DBIButtonBuilder, DBIButtonOverrides } from "../Builders/ButtonBuilder";
|
|
9
|
-
|
|
10
|
-
export interface IDBIButtonExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
|
|
11
|
-
interaction: Discord.ButtonInteraction<"cached">;
|
|
12
|
-
data: TDBIReferencedData[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type TDBIButtonOmitted<TNamespace extends NamespaceEnums> = Omit<DBIButton<TNamespace>, "type" | "description" | "dbi" | "toJSON" | "createBuilder" | "at">;
|
|
16
|
-
|
|
17
|
-
export class DBIButton<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
|
|
18
|
-
constructor(dbi: DBI<TNamespace>, args: TDBIButtonOmitted<TNamespace>) {
|
|
19
|
-
super(dbi, {
|
|
20
|
-
...(args as any),
|
|
21
|
-
type: "Button",
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare options?: Omit<Discord.ButtonComponentData, "customId" | "type">;
|
|
26
|
-
|
|
27
|
-
override onExecute(ctx: IDBIButtonExecuteCtx<TNamespace>) { };
|
|
28
|
-
override toJSON(arg: IDBIToJSONArgs<DBIButtonOverrides> = {}): Discord.ButtonComponentData {
|
|
29
|
-
return {
|
|
30
|
-
...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),
|
|
31
|
-
customId: buildCustomId(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl),
|
|
32
|
-
type: Discord.ComponentType.Button,
|
|
33
|
-
} as any;
|
|
34
|
-
};
|
|
35
|
-
createBuilder(arg: IDBIToJSONArgs<DBIButtonOverrides> = {}): DBIButtonBuilder<TNamespace> {
|
|
36
|
-
return new DBIButtonBuilder({ component: this, ...arg })
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import Discord from "discord.js";
|
|
2
|
-
import { DBI } from "../../DBI";
|
|
3
|
-
import { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from "../Interaction";
|
|
4
|
-
import { buildCustomId } from "../../utils/customId";
|
|
5
|
-
import { IDBIToJSONArgs } from "../../utils/UtilTypes";
|
|
6
|
-
import { NamespaceEnums } from "../../../generated/namespaceData";
|
|
7
|
-
import stuffs from "stuffs";
|
|
8
|
-
import { DBIChannelSelectMenuBuilder, DBIChannelSelectMenuOverrides } from "../Builders/ChannelSelectMenuBuilder";
|
|
9
|
-
|
|
10
|
-
export interface IDBIChannelSelectMenuExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
|
|
11
|
-
interaction: Discord.ChannelSelectMenuInteraction<"cached">;
|
|
12
|
-
data: TDBIReferencedData[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type TDBIChannelSelectMenuOmitted<TNamespace extends NamespaceEnums> = Omit<DBIChannelSelectMenu<TNamespace>, "type" | "description" | "dbi" | "toJSON" | "createBuilder" | "at">;
|
|
16
|
-
|
|
17
|
-
export type SelectMenuDefaultOptions = Omit<Discord.ChannelSelectMenuComponentData, "customId" | "type" | "options">;
|
|
18
|
-
|
|
19
|
-
export class DBIChannelSelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
|
|
20
|
-
constructor(dbi: DBI<TNamespace>, args: TDBIChannelSelectMenuOmitted<TNamespace>) {
|
|
21
|
-
super(dbi, {
|
|
22
|
-
...(args as any),
|
|
23
|
-
type: "ChannelSelectMenu",
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
declare options?: SelectMenuDefaultOptions;
|
|
28
|
-
|
|
29
|
-
override onExecute(ctx: IDBIChannelSelectMenuExecuteCtx<TNamespace>) { };
|
|
30
|
-
|
|
31
|
-
override toJSON(arg: IDBIToJSONArgs<DBIChannelSelectMenuOverrides> = {}): Discord.ChannelSelectMenuComponentData {
|
|
32
|
-
return {
|
|
33
|
-
...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),
|
|
34
|
-
customId: buildCustomId(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl),
|
|
35
|
-
type: Discord.ComponentType.ChannelSelect,
|
|
36
|
-
} as any;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
createBuilder(arg: IDBIToJSONArgs<DBIChannelSelectMenuOverrides> = {}): DBIChannelSelectMenuBuilder<TNamespace> {
|
|
40
|
-
return new DBIChannelSelectMenuBuilder({ component: this, ...arg })
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { NamespaceEnums } from "../../../../generated/namespaceData";
|
|
2
|
-
import { DBI } from "../../../DBI";
|
|
3
|
-
import { IDBIButtonExecuteCtx } from "../Button";
|
|
4
|
-
import { IDBIChannelSelectMenuExecuteCtx } from "../ChannelSelectMenu";
|
|
5
|
-
import { IDBIMentionableSelectMenuExecuteCtx } from "../MentionableSelectMenu";
|
|
6
|
-
import { IDBIModalExecuteCtx } from "../Modal";
|
|
7
|
-
import { IDBIRoleSelectMenuExecuteCtx } from "../RoleSelectMenu";
|
|
8
|
-
import { IDBIStringSelectMenuExecuteCtx } from "../StringSelectMenu";
|
|
9
|
-
import { IDBIUserSelectMenuExecuteCtx } from "../UserSelectMenu";
|
|
10
|
-
|
|
11
|
-
export interface IDBIHanlder<TNamespace extends NamespaceEnums, TExecuteCtx> {
|
|
12
|
-
name: string;
|
|
13
|
-
onExecute?: (ctx: TExecuteCtx) => void;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class DBIHTMLComponentsV2Handlers<TNamespace extends NamespaceEnums> {
|
|
17
|
-
dbi: DBI<TNamespace>;
|
|
18
|
-
|
|
19
|
-
constructor(dbi: DBI<TNamespace>) {
|
|
20
|
-
this.dbi = dbi;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
button(cfg: IDBIHanlder<TNamespace, IDBIButtonExecuteCtx<TNamespace>>) {
|
|
24
|
-
return {
|
|
25
|
-
name: cfg.name,
|
|
26
|
-
onExecute: cfg.onExecute,
|
|
27
|
-
type: "Button",
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
channelSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIChannelSelectMenuExecuteCtx<TNamespace>>) {
|
|
32
|
-
return {
|
|
33
|
-
name: cfg.name,
|
|
34
|
-
onExecute: cfg.onExecute,
|
|
35
|
-
type: "ChannelSelectMenu",
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
mentionableSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIMentionableSelectMenuExecuteCtx<TNamespace>>) {
|
|
40
|
-
return {
|
|
41
|
-
name: cfg.name,
|
|
42
|
-
onExecute: cfg.onExecute,
|
|
43
|
-
type: "MentionableSelectMenu",
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
modal(cfg: IDBIHanlder<TNamespace, IDBIModalExecuteCtx<TNamespace>>) {
|
|
48
|
-
return {
|
|
49
|
-
name: cfg.name,
|
|
50
|
-
onExecute: cfg.onExecute,
|
|
51
|
-
type: "Modal",
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
roleSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIRoleSelectMenuExecuteCtx<TNamespace>>) {
|
|
56
|
-
return {
|
|
57
|
-
name: cfg.name,
|
|
58
|
-
onExecute: cfg.onExecute,
|
|
59
|
-
type: "RoleSelectMenu",
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
stringSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIStringSelectMenuExecuteCtx<TNamespace>>) {
|
|
64
|
-
return {
|
|
65
|
-
name: cfg.name,
|
|
66
|
-
onExecute: cfg.onExecute,
|
|
67
|
-
type: "StringSelectMenu",
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
userSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIUserSelectMenuExecuteCtx<TNamespace>>) {
|
|
72
|
-
return {
|
|
73
|
-
name: cfg.name,
|
|
74
|
-
onExecute: cfg.onExecute,
|
|
75
|
-
type: "UserSelectMenu",
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|