@mostfeatured/dbi 0.0.54 → 0.0.56

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.
Files changed (62) hide show
  1. package/dist/DBI.d.ts +156 -156
  2. package/dist/DBI.js +332 -332
  3. package/dist/Events.d.ts +53 -53
  4. package/dist/Events.js +58 -58
  5. package/dist/data/eventMap.json +234 -234
  6. package/dist/index.d.ts +6 -6
  7. package/dist/index.js +16 -16
  8. package/dist/methods/hookEventListeners.d.ts +3 -3
  9. package/dist/methods/hookEventListeners.js +87 -87
  10. package/dist/methods/hookInteractionListeners.d.ts +3 -3
  11. package/dist/methods/hookInteractionListeners.js +118 -118
  12. package/dist/methods/publishInteractions.d.ts +7 -7
  13. package/dist/methods/publishInteractions.js +238 -238
  14. package/dist/types/Button.d.ts +18 -18
  15. package/dist/types/Button.js +31 -31
  16. package/dist/types/ButtonBuilder.d.ts +29 -29
  17. package/dist/types/ButtonBuilder.js +42 -42
  18. package/dist/types/ChatInput/ChatInput.d.ts +15 -15
  19. package/dist/types/ChatInput/ChatInput.js +20 -20
  20. package/dist/types/ChatInput/ChatInputOptions.d.ts +162 -162
  21. package/dist/types/ChatInput/ChatInputOptions.js +161 -161
  22. package/dist/types/CustomEvent.d.ts +13 -13
  23. package/dist/types/CustomEvent.js +19 -19
  24. package/dist/types/Event.d.ts +263 -263
  25. package/dist/types/Event.js +22 -22
  26. package/dist/types/Interaction.d.ts +47 -47
  27. package/dist/types/Interaction.js +24 -24
  28. package/dist/types/InteractionLocale.d.ts +25 -25
  29. package/dist/types/InteractionLocale.js +14 -14
  30. package/dist/types/Locale.d.ts +21 -21
  31. package/dist/types/Locale.js +38 -38
  32. package/dist/types/MessageContextMenu.d.ts +14 -14
  33. package/dist/types/MessageContextMenu.js +18 -18
  34. package/dist/types/Modal.d.ts +22 -22
  35. package/dist/types/Modal.js +29 -29
  36. package/dist/types/ModalBuilder.d.ts +30 -30
  37. package/dist/types/ModalBuilder.js +42 -42
  38. package/dist/types/SelectMenu.d.ts +18 -18
  39. package/dist/types/SelectMenu.d.ts.map +1 -1
  40. package/dist/types/SelectMenu.js +31 -31
  41. package/dist/types/SelectMenu.js.map +1 -1
  42. package/dist/types/SelectMenuBuilder.d.ts +27 -27
  43. package/dist/types/SelectMenuBuilder.d.ts.map +1 -1
  44. package/dist/types/SelectMenuBuilder.js +42 -42
  45. package/dist/types/SelectMenuBuilder.js.map +1 -1
  46. package/dist/types/UserContextMenu.d.ts +14 -14
  47. package/dist/types/UserContextMenu.js +18 -18
  48. package/dist/utils/MemoryStore.d.ts +8 -8
  49. package/dist/utils/MemoryStore.js +29 -29
  50. package/dist/utils/UtilTypes.d.ts +7 -7
  51. package/dist/utils/UtilTypes.js +2 -2
  52. package/dist/utils/customId.d.ts +7 -7
  53. package/dist/utils/customId.js +45 -45
  54. package/dist/utils/permissions.d.ts +2 -2
  55. package/dist/utils/permissions.js +8 -8
  56. package/dist/utils/recursiveImport.d.ts +4 -4
  57. package/dist/utils/recursiveImport.js +26 -26
  58. package/package.json +2 -2
  59. package/readme.md +5 -5
  60. package/src/types/SelectMenu.ts +2 -2
  61. package/src/types/SelectMenuBuilder.ts +3 -3
  62. package/test.js +0 -34
package/package.json CHANGED
@@ -3,13 +3,13 @@
3
3
  "@discordjs/rest": "^1.0.1",
4
4
  "discord-api-types": "^0.37.0",
5
5
  "discord-hybrid-sharding": "^1.7.4",
6
- "discord.js": "^14.6.0",
6
+ "discord.js": "^14.7.0",
7
7
  "lodash": "^4.17.21",
8
8
  "snakecase-keys": "^5.4.2",
9
9
  "stuffs": "^0.1.21"
10
10
  },
11
11
  "name": "@mostfeatured/dbi",
12
- "version": "0.0.54",
12
+ "version": "0.0.56",
13
13
  "main": "dist/index.js",
14
14
  "type": "commonjs",
15
15
  "private": false,
package/readme.md CHANGED
@@ -103,7 +103,7 @@ Remember, you can summon as many features as you want at the same time!
103
103
 
104
104
  `ChatInput` is defined as "Slash Command" as you can understand.
105
105
 
106
- <sub>`src/chatInput.js` dosyası:</sub>
106
+ <sub>`src/chatInput.js` file:</sub>
107
107
 
108
108
  ```js
109
109
  const dbi = require("../dbi");
@@ -150,7 +150,7 @@ You can also find more examples below for a sample demonstration of how the Loca
150
150
 
151
151
  # Event
152
152
 
153
- <sub>`src/event.js` dosyası:</sub>
153
+ <sub>`src/event.js` file:</sub>
154
154
 
155
155
  ```js
156
156
  const dbi = require("../dbi");
@@ -168,7 +168,7 @@ When defining an event, you can write the name of the event you want in the `nam
168
168
 
169
169
  # Locale
170
170
 
171
- <sub>`src/locales.js` dosyası:</sub>
171
+ <sub>`src/locales.js` file:</sub>
172
172
 
173
173
  ```js
174
174
  const dbi = require("../dbi");
@@ -204,7 +204,7 @@ Thanks to Locale, there is information in each interaction that will make it eas
204
204
 
205
205
  In this section, we will look at three of our features. (Actually, it's all the same feature in the background.)
206
206
 
207
- <sub>`src/components.js` dosyası:</sub>
207
+ <sub>`src/components.js` file:</sub>
208
208
 
209
209
  ```js
210
210
  const dbi = require("../dbi");
@@ -233,7 +233,7 @@ It has exactly the same properties as `ChatInput` but does not take `options` va
233
233
  We offer you another unique feature. You can now define a custom script language for each user.
234
234
  For example, the command that appears as `/select gender` to a Turkish user may appear as `/select gender` to a foreign user. (You can configure it as you wish.)
235
235
 
236
- <sub>`src/interactionlocales.js` dosyası:</sub>
236
+ <sub>`src/interactionlocales.js` file:</sub>
237
237
 
238
238
  ```js
239
239
  const dbi = require("../dbi");
@@ -23,11 +23,11 @@ export class DBISelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInt
23
23
  });
24
24
  }
25
25
 
26
- declare options: Omit<Discord.SelectMenuComponentData, "customId" | "type">;
26
+ declare options: Omit<Discord.BaseSelectMenuComponentData, "customId" | "type">;
27
27
 
28
28
  override onExecute(ctx: IDBISelectMenuExecuteCtx<TNamespace>): Promise<void> | void { };
29
29
 
30
- toJSON(arg: IDBIToJSONArgs<DBISelectMenuOverrides> = {}): Discord.SelectMenuComponentData {
30
+ toJSON(arg: IDBIToJSONArgs<DBISelectMenuOverrides> = {}): Discord.BaseSelectMenuComponentData {
31
31
  return {
32
32
  ...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),
33
33
  customId: customIdBuilder(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl),
@@ -1,9 +1,9 @@
1
- import { SelectMenuComponentData } from "discord.js";
1
+ import { BaseSelectMenuComponentData } from "discord.js";
2
2
  import { defaultify } from "stuffs";
3
3
  import { NamespaceEnums } from "../../generated/namespaceData";
4
4
  import { DBISelectMenu } from "./SelectMenu";
5
5
 
6
- export type DBISelectMenuOverrides = Omit<SelectMenuComponentData, "customId" | "type">
6
+ export type DBISelectMenuOverrides = Omit<BaseSelectMenuComponentData, "customId" | "type">
7
7
 
8
8
  export class DBISelectMenuBuilder<TNamespace extends NamespaceEnums> {
9
9
  component: DBISelectMenu<TNamespace>
@@ -45,7 +45,7 @@ export class DBISelectMenuBuilder<TNamespace extends NamespaceEnums> {
45
45
  return this;
46
46
  }
47
47
 
48
- toJSON(): SelectMenuComponentData {
48
+ toJSON(): BaseSelectMenuComponentData {
49
49
  return this.component.toJSON({ overrides: this.overrides, reference: this.reference });
50
50
  }
51
51
 
package/test.js DELETED
@@ -1,34 +0,0 @@
1
- const { createDBI } = require("./dist");
2
-
3
- const dbi = createDBI("test", {
4
- discord: { options: { intents: [] }, token: "" },
5
- });
6
-
7
- dbi.emit("momCreate", { mom: { test: "zort" } });
8
-
9
- dbi.register(({ Event, CustomEvent }) => {
10
-
11
- CustomEvent({
12
- name: "momCreate",
13
- map: {
14
- mom: "import('discord.js').GuildMember"
15
- },
16
- })
17
-
18
- Event({
19
- name: "momCreate",
20
- onExecute({mom}) {
21
-
22
- mom.ban({reason: "Aneni banladım"})
23
-
24
- }
25
- })
26
- });
27
- dbi.data.eventMap
28
- dbi.events.on("eventError", (data) => {
29
-
30
- if (data.eventName == "momCreate") {
31
- data.mom
32
- }
33
-
34
- })