@mostfeatured/dbi 0.1.47 → 0.2.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.
Files changed (299) hide show
  1. package/dist/src/DBI.d.ts.map +1 -0
  2. package/dist/src/DBI.js.map +1 -0
  3. package/dist/src/Events.d.ts.map +1 -0
  4. package/dist/src/Events.js.map +1 -0
  5. package/dist/src/index.d.ts.map +1 -0
  6. package/dist/src/index.js.map +1 -0
  7. package/dist/src/methods/handleMessageCommands.d.ts.map +1 -0
  8. package/dist/src/methods/handleMessageCommands.js.map +1 -0
  9. package/dist/src/methods/hookEventListeners.d.ts.map +1 -0
  10. package/dist/src/methods/hookEventListeners.js.map +1 -0
  11. package/dist/src/methods/hookInteractionListeners.d.ts.map +1 -0
  12. package/dist/{methods → src/methods}/hookInteractionListeners.js +22 -12
  13. package/dist/src/methods/hookInteractionListeners.js.map +1 -0
  14. package/dist/src/methods/publishInteractions.d.ts.map +1 -0
  15. package/dist/src/methods/publishInteractions.js.map +1 -0
  16. package/dist/src/types/ApplicationRoleConnectionMetadata.d.ts.map +1 -0
  17. package/dist/src/types/ApplicationRoleConnectionMetadata.js.map +1 -0
  18. package/dist/src/types/Builders/ButtonBuilder.d.ts.map +1 -0
  19. package/dist/src/types/Builders/ButtonBuilder.js.map +1 -0
  20. package/dist/src/types/Builders/ChannelSelectMenuBuilder.d.ts.map +1 -0
  21. package/dist/src/types/Builders/ChannelSelectMenuBuilder.js.map +1 -0
  22. package/dist/src/types/Builders/MentionableSelectMenuBuilder.d.ts.map +1 -0
  23. package/dist/src/types/Builders/MentionableSelectMenuBuilder.js.map +1 -0
  24. package/dist/src/types/Builders/ModalBuilder.d.ts.map +1 -0
  25. package/dist/src/types/Builders/ModalBuilder.js.map +1 -0
  26. package/dist/src/types/Builders/RoleSelectMenuBuilder.d.ts.map +1 -0
  27. package/dist/src/types/Builders/RoleSelectMenuBuilder.js.map +1 -0
  28. package/dist/src/types/Builders/StringSelectMenuBuilder.d.ts.map +1 -0
  29. package/dist/src/types/Builders/StringSelectMenuBuilder.js.map +1 -0
  30. package/dist/src/types/Builders/UserSelectMenuBuilder.d.ts.map +1 -0
  31. package/dist/src/types/Builders/UserSelectMenuBuilder.js.map +1 -0
  32. package/dist/src/types/ChatInput/ChatInput.d.ts.map +1 -0
  33. package/dist/src/types/ChatInput/ChatInput.js.map +1 -0
  34. package/dist/{types → src/types}/ChatInput/ChatInputOptions.d.ts +2 -2
  35. package/dist/src/types/ChatInput/ChatInputOptions.d.ts.map +1 -0
  36. package/dist/src/types/ChatInput/ChatInputOptions.js.map +1 -0
  37. package/dist/src/types/Components/Button.d.ts.map +1 -0
  38. package/dist/src/types/Components/Button.js.map +1 -0
  39. package/dist/src/types/Components/ChannelSelectMenu.d.ts.map +1 -0
  40. package/dist/src/types/Components/ChannelSelectMenu.js.map +1 -0
  41. package/dist/src/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.d.ts.map +1 -0
  42. package/dist/src/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.js.map +1 -0
  43. package/dist/src/types/Components/HTMLComponentsV2/index.d.ts +91 -0
  44. package/dist/src/types/Components/HTMLComponentsV2/index.d.ts.map +1 -0
  45. package/dist/src/types/Components/HTMLComponentsV2/index.js +300 -0
  46. package/dist/src/types/Components/HTMLComponentsV2/index.js.map +1 -0
  47. package/dist/src/types/Components/HTMLComponentsV2/parser.d.ts.map +1 -0
  48. package/dist/{types → src/types}/Components/HTMLComponentsV2/parser.js +11 -4
  49. package/dist/src/types/Components/HTMLComponentsV2/parser.js.map +1 -0
  50. package/dist/src/types/Components/HTMLComponentsV2/svelteParser.d.ts +35 -0
  51. package/dist/src/types/Components/HTMLComponentsV2/svelteParser.d.ts.map +1 -0
  52. package/dist/src/types/Components/HTMLComponentsV2/svelteParser.js +822 -0
  53. package/dist/src/types/Components/HTMLComponentsV2/svelteParser.js.map +1 -0
  54. package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.d.ts +24 -0
  55. package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.d.ts.map +1 -0
  56. package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.js +294 -0
  57. package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.js.map +1 -0
  58. package/dist/src/types/Components/MentionableSelectMenu.d.ts.map +1 -0
  59. package/dist/src/types/Components/MentionableSelectMenu.js.map +1 -0
  60. package/dist/src/types/Components/Modal.d.ts.map +1 -0
  61. package/dist/src/types/Components/Modal.js.map +1 -0
  62. package/dist/src/types/Components/RoleSelectMenu.d.ts.map +1 -0
  63. package/dist/src/types/Components/RoleSelectMenu.js.map +1 -0
  64. package/dist/src/types/Components/StringSelectMenu.d.ts.map +1 -0
  65. package/dist/src/types/Components/StringSelectMenu.js.map +1 -0
  66. package/dist/src/types/Components/UserSelectMenu.d.ts.map +1 -0
  67. package/dist/src/types/Components/UserSelectMenu.js.map +1 -0
  68. package/dist/src/types/Event.d.ts.map +1 -0
  69. package/dist/src/types/Event.js.map +1 -0
  70. package/dist/src/types/Interaction.d.ts.map +1 -0
  71. package/dist/src/types/Interaction.js.map +1 -0
  72. package/dist/src/types/other/CustomEvent.d.ts.map +1 -0
  73. package/dist/src/types/other/CustomEvent.js.map +1 -0
  74. package/dist/src/types/other/FakeMessageInteraction.d.ts.map +1 -0
  75. package/dist/src/types/other/FakeMessageInteraction.js.map +1 -0
  76. package/dist/src/types/other/InteractionLocale.d.ts.map +1 -0
  77. package/dist/src/types/other/InteractionLocale.js.map +1 -0
  78. package/dist/src/types/other/Locale.d.ts.map +1 -0
  79. package/dist/src/types/other/Locale.js.map +1 -0
  80. package/dist/src/types/other/MessageContextMenu.d.ts.map +1 -0
  81. package/dist/src/types/other/MessageContextMenu.js.map +1 -0
  82. package/dist/src/types/other/UserContextMenu.d.ts.map +1 -0
  83. package/dist/src/types/other/UserContextMenu.js.map +1 -0
  84. package/dist/src/utils/MemoryStore.d.ts.map +1 -0
  85. package/dist/src/utils/MemoryStore.js.map +1 -0
  86. package/dist/src/utils/UtilTypes.d.ts.map +1 -0
  87. package/dist/src/utils/UtilTypes.js.map +1 -0
  88. package/dist/src/utils/customId.d.ts.map +1 -0
  89. package/dist/src/utils/customId.js.map +1 -0
  90. package/dist/src/utils/permissions.d.ts.map +1 -0
  91. package/dist/src/utils/permissions.js.map +1 -0
  92. package/dist/src/utils/recursiveImport.d.ts.map +1 -0
  93. package/dist/src/utils/recursiveImport.js.map +1 -0
  94. package/dist/src/utils/recursiveUnload.d.ts.map +1 -0
  95. package/dist/src/utils/recursiveUnload.js.map +1 -0
  96. package/dist/src/utils/unloadModule.d.ts.map +1 -0
  97. package/dist/src/utils/unloadModule.js.map +1 -0
  98. package/dist/test/index.d.ts +2 -0
  99. package/dist/test/index.d.ts.map +1 -0
  100. package/dist/test/index.js +103 -0
  101. package/dist/test/index.js.map +1 -0
  102. package/docs/ADVANCED_FEATURES.md +836 -0
  103. package/docs/API_REFERENCE.md +925 -0
  104. package/docs/CHAT_INPUT.md +807 -0
  105. package/docs/COMPONENTS.md +1035 -0
  106. package/docs/EVENTS.md +564 -0
  107. package/docs/GETTING_STARTED.md +394 -0
  108. package/docs/LOCALIZATION.md +773 -0
  109. package/docs/README.md +341 -0
  110. package/docs/SVELTE_COMPONENTS.md +955 -0
  111. package/generated/globals.d.ts +1 -0
  112. package/generated/index.d.ts +30 -0
  113. package/generated/svelte-dbi.d.ts +588 -0
  114. package/package.json +57 -47
  115. package/readme.md +168 -491
  116. package/src/methods/hookInteractionListeners.ts +23 -12
  117. package/src/types/Components/HTMLComponentsV2/index.ts +353 -12
  118. package/src/types/Components/HTMLComponentsV2/parser.ts +14 -4
  119. package/src/types/Components/HTMLComponentsV2/svelteParser.ts +904 -0
  120. package/src/types/Components/HTMLComponentsV2/svelteRenderer.ts +332 -0
  121. package/test/index.ts +105 -0
  122. package/test/product-showcase.svelte +199 -0
  123. package/tsconfig.json +13 -3
  124. package/dist/DBI.d.ts.map +0 -1
  125. package/dist/DBI.js.map +0 -1
  126. package/dist/Events.d.ts.map +0 -1
  127. package/dist/Events.js.map +0 -1
  128. package/dist/index.d.ts.map +0 -1
  129. package/dist/index.js.map +0 -1
  130. package/dist/methods/handleMessageCommands.d.ts.map +0 -1
  131. package/dist/methods/handleMessageCommands.js.map +0 -1
  132. package/dist/methods/hookEventListeners.d.ts.map +0 -1
  133. package/dist/methods/hookEventListeners.js.map +0 -1
  134. package/dist/methods/hookInteractionListeners.d.ts.map +0 -1
  135. package/dist/methods/hookInteractionListeners.js.map +0 -1
  136. package/dist/methods/publishInteractions.d.ts.map +0 -1
  137. package/dist/methods/publishInteractions.js.map +0 -1
  138. package/dist/types/ApplicationRoleConnectionMetadata.d.ts.map +0 -1
  139. package/dist/types/ApplicationRoleConnectionMetadata.js.map +0 -1
  140. package/dist/types/Builders/ButtonBuilder.d.ts.map +0 -1
  141. package/dist/types/Builders/ButtonBuilder.js.map +0 -1
  142. package/dist/types/Builders/ChannelSelectMenuBuilder.d.ts.map +0 -1
  143. package/dist/types/Builders/ChannelSelectMenuBuilder.js.map +0 -1
  144. package/dist/types/Builders/MentionableSelectMenuBuilder.d.ts.map +0 -1
  145. package/dist/types/Builders/MentionableSelectMenuBuilder.js.map +0 -1
  146. package/dist/types/Builders/ModalBuilder.d.ts.map +0 -1
  147. package/dist/types/Builders/ModalBuilder.js.map +0 -1
  148. package/dist/types/Builders/RoleSelectMenuBuilder.d.ts.map +0 -1
  149. package/dist/types/Builders/RoleSelectMenuBuilder.js.map +0 -1
  150. package/dist/types/Builders/StringSelectMenuBuilder.d.ts.map +0 -1
  151. package/dist/types/Builders/StringSelectMenuBuilder.js.map +0 -1
  152. package/dist/types/Builders/UserSelectMenuBuilder.d.ts.map +0 -1
  153. package/dist/types/Builders/UserSelectMenuBuilder.js.map +0 -1
  154. package/dist/types/ChatInput/ChatInput.d.ts.map +0 -1
  155. package/dist/types/ChatInput/ChatInput.js.map +0 -1
  156. package/dist/types/ChatInput/ChatInputOptions.d.ts.map +0 -1
  157. package/dist/types/ChatInput/ChatInputOptions.js.map +0 -1
  158. package/dist/types/Components/Button.d.ts.map +0 -1
  159. package/dist/types/Components/Button.js.map +0 -1
  160. package/dist/types/Components/ChannelSelectMenu.d.ts.map +0 -1
  161. package/dist/types/Components/ChannelSelectMenu.js.map +0 -1
  162. package/dist/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.d.ts.map +0 -1
  163. package/dist/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.js.map +0 -1
  164. package/dist/types/Components/HTMLComponentsV2/index.d.ts +0 -19
  165. package/dist/types/Components/HTMLComponentsV2/index.d.ts.map +0 -1
  166. package/dist/types/Components/HTMLComponentsV2/index.js +0 -31
  167. package/dist/types/Components/HTMLComponentsV2/index.js.map +0 -1
  168. package/dist/types/Components/HTMLComponentsV2/parser.d.ts.map +0 -1
  169. package/dist/types/Components/HTMLComponentsV2/parser.js.map +0 -1
  170. package/dist/types/Components/MentionableSelectMenu.d.ts.map +0 -1
  171. package/dist/types/Components/MentionableSelectMenu.js.map +0 -1
  172. package/dist/types/Components/Modal.d.ts.map +0 -1
  173. package/dist/types/Components/Modal.js.map +0 -1
  174. package/dist/types/Components/RoleSelectMenu.d.ts.map +0 -1
  175. package/dist/types/Components/RoleSelectMenu.js.map +0 -1
  176. package/dist/types/Components/StringSelectMenu.d.ts.map +0 -1
  177. package/dist/types/Components/StringSelectMenu.js.map +0 -1
  178. package/dist/types/Components/UserSelectMenu.d.ts.map +0 -1
  179. package/dist/types/Components/UserSelectMenu.js.map +0 -1
  180. package/dist/types/Event.d.ts.map +0 -1
  181. package/dist/types/Event.js.map +0 -1
  182. package/dist/types/Interaction.d.ts.map +0 -1
  183. package/dist/types/Interaction.js.map +0 -1
  184. package/dist/types/other/CustomEvent.d.ts.map +0 -1
  185. package/dist/types/other/CustomEvent.js.map +0 -1
  186. package/dist/types/other/FakeMessageInteraction.d.ts.map +0 -1
  187. package/dist/types/other/FakeMessageInteraction.js.map +0 -1
  188. package/dist/types/other/InteractionLocale.d.ts.map +0 -1
  189. package/dist/types/other/InteractionLocale.js.map +0 -1
  190. package/dist/types/other/Locale.d.ts.map +0 -1
  191. package/dist/types/other/Locale.js.map +0 -1
  192. package/dist/types/other/MessageContextMenu.d.ts.map +0 -1
  193. package/dist/types/other/MessageContextMenu.js.map +0 -1
  194. package/dist/types/other/UserContextMenu.d.ts.map +0 -1
  195. package/dist/types/other/UserContextMenu.js.map +0 -1
  196. package/dist/utils/MemoryStore.d.ts.map +0 -1
  197. package/dist/utils/MemoryStore.js.map +0 -1
  198. package/dist/utils/UtilTypes.d.ts.map +0 -1
  199. package/dist/utils/UtilTypes.js.map +0 -1
  200. package/dist/utils/customId.d.ts.map +0 -1
  201. package/dist/utils/customId.js.map +0 -1
  202. package/dist/utils/permissions.d.ts.map +0 -1
  203. package/dist/utils/permissions.js.map +0 -1
  204. package/dist/utils/recursiveImport.d.ts.map +0 -1
  205. package/dist/utils/recursiveImport.js.map +0 -1
  206. package/dist/utils/recursiveUnload.d.ts.map +0 -1
  207. package/dist/utils/recursiveUnload.js.map +0 -1
  208. package/dist/utils/unloadModule.d.ts.map +0 -1
  209. package/dist/utils/unloadModule.js.map +0 -1
  210. package/examples/modal/dbi.js +0 -30
  211. package/examples/modal/login.js +0 -15
  212. package/examples/modal/package.json +0 -15
  213. package/examples/modal/publish.js +0 -13
  214. package/examples/modal/src/chatInput.js +0 -38
  215. package/examples/modal/src/components.js +0 -33
  216. package/examples/modal/src/event.js +0 -20
  217. package/examples/modal/src/interactionlocales.js +0 -24
  218. package/examples/modal/src/locales.js +0 -38
  219. package/examples/modal/src/modal.js +0 -28
  220. /package/dist/{DBI.d.ts → src/DBI.d.ts} +0 -0
  221. /package/dist/{DBI.js → src/DBI.js} +0 -0
  222. /package/dist/{Events.d.ts → src/Events.d.ts} +0 -0
  223. /package/dist/{Events.js → src/Events.js} +0 -0
  224. /package/dist/{data → src/data}/eventMap.json +0 -0
  225. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  226. /package/dist/{index.js → src/index.js} +0 -0
  227. /package/dist/{methods → src/methods}/handleMessageCommands.d.ts +0 -0
  228. /package/dist/{methods → src/methods}/handleMessageCommands.js +0 -0
  229. /package/dist/{methods → src/methods}/hookEventListeners.d.ts +0 -0
  230. /package/dist/{methods → src/methods}/hookEventListeners.js +0 -0
  231. /package/dist/{methods → src/methods}/hookInteractionListeners.d.ts +0 -0
  232. /package/dist/{methods → src/methods}/publishInteractions.d.ts +0 -0
  233. /package/dist/{methods → src/methods}/publishInteractions.js +0 -0
  234. /package/dist/{types → src/types}/ApplicationRoleConnectionMetadata.d.ts +0 -0
  235. /package/dist/{types → src/types}/ApplicationRoleConnectionMetadata.js +0 -0
  236. /package/dist/{types → src/types}/Builders/ButtonBuilder.d.ts +0 -0
  237. /package/dist/{types → src/types}/Builders/ButtonBuilder.js +0 -0
  238. /package/dist/{types → src/types}/Builders/ChannelSelectMenuBuilder.d.ts +0 -0
  239. /package/dist/{types → src/types}/Builders/ChannelSelectMenuBuilder.js +0 -0
  240. /package/dist/{types → src/types}/Builders/MentionableSelectMenuBuilder.d.ts +0 -0
  241. /package/dist/{types → src/types}/Builders/MentionableSelectMenuBuilder.js +0 -0
  242. /package/dist/{types → src/types}/Builders/ModalBuilder.d.ts +0 -0
  243. /package/dist/{types → src/types}/Builders/ModalBuilder.js +0 -0
  244. /package/dist/{types → src/types}/Builders/RoleSelectMenuBuilder.d.ts +0 -0
  245. /package/dist/{types → src/types}/Builders/RoleSelectMenuBuilder.js +0 -0
  246. /package/dist/{types → src/types}/Builders/StringSelectMenuBuilder.d.ts +0 -0
  247. /package/dist/{types → src/types}/Builders/StringSelectMenuBuilder.js +0 -0
  248. /package/dist/{types → src/types}/Builders/UserSelectMenuBuilder.d.ts +0 -0
  249. /package/dist/{types → src/types}/Builders/UserSelectMenuBuilder.js +0 -0
  250. /package/dist/{types → src/types}/ChatInput/ChatInput.d.ts +0 -0
  251. /package/dist/{types → src/types}/ChatInput/ChatInput.js +0 -0
  252. /package/dist/{types → src/types}/ChatInput/ChatInputOptions.js +0 -0
  253. /package/dist/{types → src/types}/Components/Button.d.ts +0 -0
  254. /package/dist/{types → src/types}/Components/Button.js +0 -0
  255. /package/dist/{types → src/types}/Components/ChannelSelectMenu.d.ts +0 -0
  256. /package/dist/{types → src/types}/Components/ChannelSelectMenu.js +0 -0
  257. /package/dist/{types → src/types}/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.d.ts +0 -0
  258. /package/dist/{types → src/types}/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.js +0 -0
  259. /package/dist/{types → src/types}/Components/HTMLComponentsV2/parser.d.ts +0 -0
  260. /package/dist/{types → src/types}/Components/MentionableSelectMenu.d.ts +0 -0
  261. /package/dist/{types → src/types}/Components/MentionableSelectMenu.js +0 -0
  262. /package/dist/{types → src/types}/Components/Modal.d.ts +0 -0
  263. /package/dist/{types → src/types}/Components/Modal.js +0 -0
  264. /package/dist/{types → src/types}/Components/RoleSelectMenu.d.ts +0 -0
  265. /package/dist/{types → src/types}/Components/RoleSelectMenu.js +0 -0
  266. /package/dist/{types → src/types}/Components/StringSelectMenu.d.ts +0 -0
  267. /package/dist/{types → src/types}/Components/StringSelectMenu.js +0 -0
  268. /package/dist/{types → src/types}/Components/UserSelectMenu.d.ts +0 -0
  269. /package/dist/{types → src/types}/Components/UserSelectMenu.js +0 -0
  270. /package/dist/{types → src/types}/Event.d.ts +0 -0
  271. /package/dist/{types → src/types}/Event.js +0 -0
  272. /package/dist/{types → src/types}/Interaction.d.ts +0 -0
  273. /package/dist/{types → src/types}/Interaction.js +0 -0
  274. /package/dist/{types → src/types}/other/CustomEvent.d.ts +0 -0
  275. /package/dist/{types → src/types}/other/CustomEvent.js +0 -0
  276. /package/dist/{types → src/types}/other/FakeMessageInteraction.d.ts +0 -0
  277. /package/dist/{types → src/types}/other/FakeMessageInteraction.js +0 -0
  278. /package/dist/{types → src/types}/other/InteractionLocale.d.ts +0 -0
  279. /package/dist/{types → src/types}/other/InteractionLocale.js +0 -0
  280. /package/dist/{types → src/types}/other/Locale.d.ts +0 -0
  281. /package/dist/{types → src/types}/other/Locale.js +0 -0
  282. /package/dist/{types → src/types}/other/MessageContextMenu.d.ts +0 -0
  283. /package/dist/{types → src/types}/other/MessageContextMenu.js +0 -0
  284. /package/dist/{types → src/types}/other/UserContextMenu.d.ts +0 -0
  285. /package/dist/{types → src/types}/other/UserContextMenu.js +0 -0
  286. /package/dist/{utils → src/utils}/MemoryStore.d.ts +0 -0
  287. /package/dist/{utils → src/utils}/MemoryStore.js +0 -0
  288. /package/dist/{utils → src/utils}/UtilTypes.d.ts +0 -0
  289. /package/dist/{utils → src/utils}/UtilTypes.js +0 -0
  290. /package/dist/{utils → src/utils}/customId.d.ts +0 -0
  291. /package/dist/{utils → src/utils}/customId.js +0 -0
  292. /package/dist/{utils → src/utils}/permissions.d.ts +0 -0
  293. /package/dist/{utils → src/utils}/permissions.js +0 -0
  294. /package/dist/{utils → src/utils}/recursiveImport.d.ts +0 -0
  295. /package/dist/{utils → src/utils}/recursiveImport.js +0 -0
  296. /package/dist/{utils → src/utils}/recursiveUnload.d.ts +0 -0
  297. /package/dist/{utils → src/utils}/recursiveUnload.js +0 -0
  298. /package/dist/{utils → src/utils}/unloadModule.d.ts +0 -0
  299. /package/dist/{utils → src/utils}/unloadModule.js +0 -0
package/readme.md CHANGED
@@ -1,592 +1,269 @@
1
- # DiscordBotInfrastructure - [English]
1
+ <div align="center">
2
2
 
3
- The most advanced, up-to-date and simple to use Discord bot infrastructure you can find on the internet.
3
+ # 🤖 DBI - Discord Bot Infrastructure
4
4
 
5
- # Usage Scenario
5
+ [![npm version](https://img.shields.io/npm/v/@mostfeatured/dbi.svg?style=flat-square)](https://www.npmjs.com/package/@mostfeatured/dbi)
6
+ [![npm downloads](https://img.shields.io/npm/dm/@mostfeatured/dbi.svg?style=flat-square)](https://www.npmjs.com/package/@mostfeatured/dbi)
7
+ [![License](https://img.shields.io/npm/l/@mostfeatured/dbi.svg?style=flat-square)](LICENSE)
6
8
 
7
- The MostFeatured/DiscordBotInfrastructure project is not a stand-alone project like other infrastructures you are used to, it is an NPM module. In this context, before you start using it, you need to open a folder and download the infrastructure and discord.js by entering the `npm install @mostfeatured/dbi discord.js` command.
9
+ **The most advanced, modern, and developer-friendly Discord.js v14 bot infrastructure.**
8
10
 
9
- # While Starting
11
+ [Getting Started](#-quick-start)
12
+ [Features](#-features) •
13
+ [Documentation](#-documentation) •
14
+ [Examples](#-examples)
10
15
 
11
- First we will need `3 files` and `1 folder`. This structure can be configured completely in accordance with your working order. However, the scenario we propose is as follows.
16
+ </div>
12
17
 
13
- Files and folders that need to be opened; Files `dbi.js`, `login.js`, `publish.js` and `src` folder.
18
+ ---
14
19
 
15
- As the first step, we open our file named `dbi.js` and lay the foundations of the infrastructure in it.
16
- ```js
17
- const { createDBI } = require("@mostfeatured/dbi");
18
- let dbi = createDBI("xd", {
19
- strict: true,
20
- discord: {
21
- token: "<yourTokenHere>",
22
- options: {
23
- intents: [
24
- "Guilds"
25
- ]
26
- }
27
- },
28
- defaults: {
29
- locale: {
30
- name: "en"
31
- },
32
- defaultMemberPermissions: ["SendMessages"],
33
- directMessages: false
34
- },
35
- references: {
36
- autoClear: {
37
- ttl: 60 * 1000 * 60,
38
- check: 60 * 1000
39
- }
40
- },
41
- // Message Commands are optional. Message Commands work trough emulating the slash commands..
42
- messageCommands: {
43
- prefixes: ["!", "."],
44
- typeAliases: {
45
- booleans: {
46
- "true": true,
47
- "false": false,
48
- "yes": true,
49
- "no": false,
50
- }
51
- }
52
- }
53
- });
54
-
55
- dbi.events.on("messageCommandArgumentError", (data) => {
56
- data.message.reply(`‼️ Invalid argument \`${data.error.option.name}\` (Index: \`${data.error.index}\`). Error Kind: \`${data.error.type}\`. Expected: \`${ApplicationCommandOptionType[data.error.option.type]}\`${data.error.extra ? ` with any of \`${data.error.extra.map(i => i.name).join(", ")}\`` : ""}.`);
57
- return false;
58
- });
59
-
60
- module.exports = dbi;
61
- ```
62
-
63
- We start the infrastructure with the `createDBI()` function. The first parameter of the function is your bot's 'codeName' and the second parameter is your bot's configuration.
64
-
65
- As the second step, we open our `login.js` file and write the code group that we will use to open the bot.
66
- ```js
67
- const { Utils } = require("@mostfeatured/dbi");
68
- const dbi = require("./dbi");
69
- (async () => {
70
- await Utils.recursiveImport("./src");
71
- await dbi.load();
72
- await dbi.login();
73
- await dbi.client.user.setActivity({
74
- name: "MostFeatured ❤️ TheArmagan"
75
- });
76
- console.log(`Logged in! ${dbi.client.user.tag} (${dbi.client.user.id})`);
77
- })();
78
- ```
79
-
80
- We import the `Utils.recursiveImport()` function into it. With this function we can `import`/`require` all files in `x` folder endlessly. In this way, the infrastructure is aware of these files.
81
- We access our infrastructure from our main `dbi.js` file and create an `async` environment and first define all project files to the infrastructure. After the definition, we load all the features we have defined to the infrastructure with the `load()` function. Right after, we log in to Discord with the `login()` function.
82
-
83
- As the 3rd step, we open our `publish.js` file and repeat all the operations we did in the second step.
84
- ```js
85
- const { Utils } = require("@mostfeatured/dbi");
86
- const dbi = require("./dbi");
87
- (async () => {
88
- await Utils.recursiveImport("./src");
89
- await dbi.load();
90
- await dbi.publish("Guild", "<yourGuildId>");
91
- // await dbi.publish("Global");
92
- await dbi.unload();
93
- console.log("Published!");
94
- })();
95
- ```
96
-
97
- However, instead of calling the `login()` function, we call the `publish()` function and with this function we introduce the commands of our bot wherever we want.
98
-
99
- # Fantastic!
100
-
101
- We now have all the necessary files to use the infrastructure. (Information: If these steps that we have explained in detail are complex and difficult for you, we are sorry that this infrastructure is not suitable for you.)
102
-
103
- # Detailed Usage Scenario
104
-
105
- You can fully use all kinds of Discord's features with our specially developed infrastructure that fully supports v14. (`ChatInput`, `Event`, `Locale`, `Button`, `SelectMenu`, `MessageContextMenu`, `UserContextMenu`, `Modal`, `InteractionLocale`)
106
-
107
- Now we want to show you how to define properties in infrastructure. Example: (ChatInput/Button etc.)
108
-
109
- First, we include the relevant feature in our infrastructure.
110
- ```js
111
- const dbi = require("../dbi");
112
- ```
113
- And then we call the `register()` function on the infrastructure and put a `callback` function in it. This `callback` function presents as the first parameter everything you can define on the infrastructure as an object. You can perform the definition to the infrastructure by calling the feature function you want from this object.
114
- ```js
115
- dbi.register(({ ChatInput, Event }) => {
116
- ChatInput({ ... });
117
- Event({ ... });
118
- })
119
- ```
120
- Remember, you can summon as many features as you want at the same time!
121
-
122
- # ChatInput & ChatInputOptions
123
-
124
- `ChatInput` is defined as "Slash Command" as you can understand.
125
-
126
- <sub>`src/chatInput.js` file:</sub>
127
-
128
- ```js
129
- const dbi = require("../dbi");
130
- const Discord = require("discord.js");
20
+ ## Features
131
21
 
132
- dbi.register(({ ChatInput, ChatInputOptions }) => {
133
- ChatInput({
134
- name: "cinsiyet seç",
135
- description: "Cinsiyet seçmenizi sağlar.",
136
- onExecute({ interaction, locale }) {
137
- let gender = interaction.options.get("cinsiyet").value;
138
- let genderNames = locale.user.data.genders;
139
- let genderText = locale.user.data.genderText(interaction.user, genderNames[gender]());
140
-
141
- interaction.reply({
142
- content: genderText,
143
- components: [
144
- {
145
- type: Discord.ComponentType.ActionRow,
146
- components: [
147
- dbi.interaction("viewGender").toJSON({ overrides: { label: locale.user.data.clickText() }, reference: { ttl: 1000 * 60 * 10, data: [gender] } }),
148
- ]
149
- }
150
- ]
151
- });
152
- },
153
- options: [
154
- ChatInputOptions.stringChoices({
155
- name: "cinsiyet",
156
- description: "Seçeceğiniz cinsiyet.",
157
- required: true,
158
- choices: [
159
- { name: "Erkek", value: "erkek" },
160
- { name: "Kadın", value: "kadın" },
161
- { name: "Diğer", value: "diğer" },
162
- ]
163
- })
164
- ],
165
- });
166
- });
167
- ```
168
- In general, the structure of `ChatInput` may seem familiar to you, except for `options`. When you try to fill something in options directly, you will not get autocomplete. Because options expect static functions in ChatInputOptions class. The functions are similar to: `stringChoices`, `user`, `numberAutocomplete` etc.
169
- You can also find more examples below for a sample demonstration of how the Locale and Component system we have shown above is used.
22
+ | Feature | Description |
23
+ |---------|-------------|
24
+ | 🎯 **Slash Commands** | Full support with 14 option types, autocomplete, and subcommands |
25
+ | 🔘 **Components** | Buttons, Select Menus (5 types), and Modals with built-in state management |
26
+ | 🌍 **Localization** | Multi-language support for both content and command translations |
27
+ | 📨 **Events** | Discord events, custom events, and internal DBI events |
28
+ | 💬 **Message Commands** | Automatic slash command emulation from prefix commands |
29
+ | 🔗 **Reference System** | Pass complex data through component interactions |
30
+ | 🚀 **Multi-Client** | Run multiple bots with namespace isolation |
31
+ | ⚡ **Hybrid Sharding** | Scale to millions of servers with discord-hybrid-sharding |
32
+ | 🎨 **Svelte Components** | Build reactive Discord UIs with Svelte 5 (HTMLComponentsV2) |
33
+ | 🔄 **Hot Reloading** | Update features without restarting your bot |
34
+ | 🛡️ **Rate Limiting** | Built-in rate limit management per user/channel/guild |
35
+ | 📝 **TypeScript** | Full type safety with intelligent autocomplete |
170
36
 
171
- # Event
37
+ ---
172
38
 
173
- <sub>`src/event.js` file:</sub>
39
+ ## 📦 Installation
174
40
 
175
- ```js
176
- const dbi = require("../dbi");
177
- dbi.register(({ Event }) => {
178
- Event({
179
- name: "ready",
180
- id: "botIsReady",
181
- onExecute() {
182
- console.log(`Bot ready!`);
183
- }
184
- });
185
- });
41
+ ```bash
42
+ npm install @mostfeatured/dbi discord.js
186
43
  ```
187
- When defining an event, you can write the name of the event you want in the `name` field. However, if you want to open more than one of the same event, you need to define an 'id' for that event.
188
-
189
- # Locale
190
-
191
- <sub>`src/locales.js` file:</sub>
192
-
193
- ```js
194
- const dbi = require("../dbi");
195
- dbi.register(({ Locale }) => {
196
- Locale({
197
- name: "tr",
198
- data: {
199
- genders: {
200
- erkek: "Erkek",
201
- kadın: "Kadın",
202
- diğer: "Diğer"
203
- },
204
- genderText: "{0} adlı üye {1} cinsiyetini seçti."
205
- }
206
- });
207
- Locale({
208
- name: "en",
209
- data: {
210
- genders: {
211
- erkek: "Male",
212
- kadın: "Female",
213
- diğer: "Other"
214
- },
215
- genderText: "{0}, picked {1} gender."
216
- }
217
- });
218
- });
219
- ```
220
-
221
- Thanks to Locale, there is information in each interaction that will make it easier for you to respond according to the language of the user or the server. The `name` in Locale contains the values you want to keep, and the `data` part for which language you define. The `{0}` and `{1}` signs in the text are also our variables in the text. When using locale, we can take the value we want and call it like a function. And in it we give the parameters respectively. For example `locale.data.genderText(user, gender)`.
222
-
223
- # Button & SelectMenu & Modal
224
-
225
- In this section, we will look at three of our features. (Actually, it's all the same feature in the background.)
226
-
227
- <sub>`src/components.js` file:</sub>
228
-
229
- ```js
230
- const dbi = require("../dbi");
231
- const Discord = require("discord.js");
232
- dbi.register(({ Button, SelectMenu, Modal }) => {
233
- Button({
234
- name: "viewGender",
235
- onExecute({ interaction, data }) {
236
- interaction.reply(`\`${data[0]}\``);
237
- },
238
- options: {
239
- style: Discord.ButtonStyle.Primary,
240
- label: "View Gender"
241
- }
242
- });
243
- });
244
- ```
245
- We bring you a very cool and cool feature about Button & SelectMenu & Modal. Now you can move the value you want on them. (Like Reference/Object or text/number.) For example `dbi.interaction("viewGender").toJSON("male")` will provide us a valid component powered by Discord.js. And you can reach the value presented in the json both by turning the `options` part into a function and when the interaction itself is called. There is one thing you should not forget about this subject. If you are going to carry plain text or numbers, the total length of these texts or numbers should not exceed 100 characters. Because these values ​​are carried directly on the button and they work in such a way that they remain there even if you turn the bot off and on.
246
-
247
- # MessageContextMenu & UserContextMenu
248
-
249
- It has exactly the same properties as `ChatInput` but does not take `options` value.
250
44
 
251
- # InteractionLocale
45
+ ---
252
46
 
253
- We offer you another unique feature. You can now define a custom script language for each user.
254
- 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.)
47
+ ## 🚀 Quick Start
255
48
 
256
- <sub>`src/interactionlocales.js` file:</sub>
49
+ ### 1. Create DBI Instance
257
50
 
258
- ```js
259
- const dbi = require("../dbi");
260
- dbi.register(({ InteractionLocale }) => {
261
- InteractionLocale({
262
- name: "cinsiyet seç",
263
- data: {
264
- en: {
265
- name: "select gender",
266
- description: "Allows you to select a gender.",
267
- options: {
268
- cinsiyet: {
269
- name: "gender",
270
- description: "Select your gender correctly.",
271
- choices: {
272
- "Erkek": "Male",
273
- "Kadın": "Female",
274
- "Diğer": "Other"
275
- }
276
- }
277
- }
278
- }
279
- }
280
- });
281
- });
282
- ```
283
-
284
- Final note: The value `name` for `InteractionLocale` will be the name of one of the other interactions you define. For example `select gender`. We tried to simplify Data's structure. First you select the language you want and then you fill in the content as in the example. You can add how it will appear in as many languages as you want at the same time.
285
-
286
- You can contact me via Discord for errors or similar issues. (Armagan#4869)
287
-
288
- Remember: "There will always be something free and valuable on earth."
289
-
290
- <sub>12.09.2022: Original text written by TheArmagan, edited by Maschera. </sub>
291
-
292
- # DiscordBotInfrastructure - [Turkish]
293
-
294
- İnternet üzerinde bulabileceğiniz en gelişmiş, güncel ve kullanımı basit Discord bot altyapısı.
295
-
296
- # Kullanım Senaryosu
297
-
298
- MostFeatured/DiscordBotInfrastructure projesi diğer alışık olduğunuz altyapılar gibi kendi halinde bir proje değil, bir NPM modülüdür. Bu bağlamda kullanmaya başlamadan önce bir klasör açmanız ve içerisine `npm install @mostfeatured/dbi discord.js` komutunu girerek altyapıyı ve discord.js'i indirmeniz gerekmektedir.
299
-
300
- # Başlarken
301
-
302
- İlk olarak `3 dosya` ve `1 klasöre` ihitiyacımız olacak. Bu yapı tamamen sizin çalışma düzeninize uygun olarak konfigüre edilebilmektedir. Lakin bizim önerdiğimiz senaryo aşağıdaki gibidir.
303
-
304
- Açılması gereken dosyalar ve klasörler; `dbi.js`, `login.js`, `publish.js` dosyaları ve `src` klasörü.
305
-
306
- 1. adım olarak `dbi.js` adındaki dosyamızı açıyoruz ve içerisine altyapının temellerini atıyoruz.
307
- ```js
51
+ ```javascript
52
+ // dbi.js
308
53
  const { createDBI } = require("@mostfeatured/dbi");
309
54
 
310
- let dbi = createDBI("xd", {
55
+ const dbi = createDBI("my-bot", {
311
56
  strict: true,
312
57
  discord: {
313
- token: "<yourTokenHere>",
314
- options: {
315
- intents: [
316
- "Guilds"
317
- ]
318
- }
58
+ token: process.env.DISCORD_TOKEN,
59
+ options: { intents: ["Guilds"] }
319
60
  },
320
61
  defaults: {
321
- locale: "en",
322
- defaultMemberPermissions: ["SendMessages"],
62
+ locale: { name: "en" },
323
63
  directMessages: false
324
- },
325
- references: {
326
- autoClear: {
327
- ttl: 60 * 1000 * 60,
328
- check: 60 * 1000
329
- }
330
- },
331
- // Mesaj Komutları isteğe bağlıdır. Mesaj Komutları slash komutlarını taklit ederek çalışır. Yani siz sadece slash komut kodlasanız bile uyumlu olarak çalışacaktır.
332
- messageCommands: {
333
- prefixes: ["!", "."],
334
- typeAliases: {
335
- booleans: {
336
- "true": true,
337
- "false": false,
338
- "yes": true,
339
- "no": false,
340
- }
341
- }
342
64
  }
343
65
  });
344
66
 
345
- dbi.events.on("messageCommandArgumentError", (data) => {
346
- data.message.reply(`‼️ Hatalı argument \`${data.error.option.name}\` (Konum: \`${data.error.index}\`). Hata Tipi: \`${data.error.type}\`. Beklenen: \`${ApplicationCommandOptionType[data.error.option.type]}\`${data.error.extra ? ` şunlardan herhangi biri \`${data.error.extra.map(i => i.name).join(", ")}\`` : ""}.`);
347
- return false;
348
- });
349
-
350
67
  module.exports = dbi;
351
68
  ```
352
69
 
353
- `createDBI()` fonksiyonu ile altyapıyı başlatıyoruz. Fonksiyonun ilk parametresi botunuzun `kodAdı`, ikinci parametresi ise botunuzun konfigürasyonudur.
70
+ ### 2. Define Features
71
+
72
+ ```javascript
73
+ // src/commands/ping.js
74
+ const dbi = require("../dbi");
75
+
76
+ dbi.register(({ ChatInput }) => {
77
+ ChatInput({
78
+ name: "ping",
79
+ description: "Check bot latency",
80
+ onExecute({ interaction, dbi }) {
81
+ interaction.reply(`🏓 Pong! ${dbi.client().client.ws.ping}ms`);
82
+ }
83
+ });
84
+ });
85
+ ```
86
+
87
+ ### 3. Start Bot
354
88
 
355
- 2. adım olarak `login.js` dosyamızı açıyoruz ve içerisine botu açmak için kullanacağımız kod gurubunu yazıyoruz.
356
- ```js
89
+ ```javascript
90
+ // index.js
357
91
  const { Utils } = require("@mostfeatured/dbi");
358
92
  const dbi = require("./dbi");
359
93
 
360
94
  (async () => {
361
95
  await Utils.recursiveImport("./src");
362
-
363
96
  await dbi.load();
364
97
  await dbi.login();
365
-
366
- await dbi.client.user.setActivity({
367
- name: "MostFeatured ❤️ TheArmagan"
368
- });
369
-
370
- console.log(`Logged in! ${dbi.client.user.tag} (${dbi.client.user.id})`);
98
+ console.log(`✅ Logged in as ${dbi.client().client.user.tag}`);
371
99
  })();
372
100
  ```
373
101
 
374
- İçeriye `Utils.recursiveImport()` fonksiyonunu alıyoruz. Bu fonksiyon ile sonsuz bir şekilde `x` klasöründeki bütün dosyaları `import`/`require` edebiliyoruz. Bu sayede altyapı bu dosyalardan haberdar oluyor.
375
- Ana `dbi.js` dosyamızdan altyapımıza ulaşıyoruz ve `async` bir ortam oluşturup ilk önce tüm proje dosylarını altyapıya tanımlıyoruz. Tanımlamanın ardından tanımladığımız tüm özellikleri altyapıya `load()` fonksiyonunu ile yüklüyoruz. Hemen ardından `login()` fonksiyonu ile Discord'a giriş sağlıyoruz.
376
-
102
+ ### 4. Publish Commands
377
103
 
378
- 3. adım olarak `publish.js` dosyamızı açıyoruz ve ikinci aşamada yaptığımız tüm işlemleri tekrardan uyguluyoruz.
379
- ```js
104
+ ```javascript
105
+ // publish.js
380
106
  const { Utils } = require("@mostfeatured/dbi");
381
107
  const dbi = require("./dbi");
382
108
 
383
109
  (async () => {
384
110
  await Utils.recursiveImport("./src");
385
-
386
111
  await dbi.load();
387
- await dbi.publish("Guild", "<yourGuildId>");
388
- // await dbi.publish("Global");
112
+ await dbi.publish("Global"); // or dbi.publish("Guild", "GUILD_ID")
389
113
  await dbi.unload();
390
-
391
- console.log("Published!");
114
+ console.log("✅ Commands published!");
392
115
  })();
393
116
  ```
394
117
 
395
- Ancak `login()` fonksiyonunu çağırmak yerine, `publish()` fonksiyonunu çağrıyoruz ve bu fonksiyon ile botumuzun komutlarını istediğimiz yere tanıtıyoruz.
396
-
397
- # Harika!
118
+ ---
398
119
 
399
- Artık altyapıyı kullanabilmek için gerekli olan bütün dosyalara sahibiz. (Bilgilendirme: Detaylı bir şekilde anlattığımız bu adımlar size karmaşık ve zor geliyorsa üzgünüz ki bu altyapı size uygun değil.)
120
+ ## 💡 Examples
400
121
 
401
- # Detaylı Kullanım Senaryosu
402
-
403
- Özel olarak geliştirdiğimiz ve v14'ü eksiksiz bir şekilde destekleyen altyapımız ile Discord'un her türlü özelliğini tam anlamıyla kullanabiliyorsunuz. (`ChatInput`, `Event`, `Locale`, `Button`, `SelectMenu`, `MessageContextMenu`, `UserContextMenu`, `Modal`, `InteractionLocale`)
404
-
405
- Şimdi sizlere altyapıya özellik tanımlamayı göstermek istiyoruz. Örnek: (ChatInput/Button vb.)
406
-
407
- İlk olarak ilgili özelliği altyapımıza dahil ediyoruz.
408
- ```js
409
- const dbi = require("../dbi");
410
- ```
411
- Ve devamında altyapının üzerindeki `register()` fonksiyonunu çağırıp içerisine bir `callback` fonksiyonu koyuyoruz. Bu `callback` fonksiyonu ilk parametre olarak size altyapı üzerine tanımlayabilceğiniz tüm her şeyi bir obje olarak sunuyor. Bu obje içerisinden istediğiniz özellik fonksiyonunu çağırarak altyapıya tanımlama işlemini gerçekleştirebiliyorsunuz.
412
- ```js
413
- dbi.register(({ ChatInput, Event }) => {
414
- ChatInput({ ... });
415
- Event({ ... });
416
- })
417
- ```
418
- Unutmayın ki aynı anda istediğiniz kadar özelliği çağırabilirsiniz!
419
-
420
- # ChatInput & ChatInputOptions
421
-
422
- `ChatInput` sizin anlayacağınız şekilde "Slash Komut" olarak tanımlanmaktadır.
423
-
424
- <sub>`src/chatInput.js` dosyası:</sub>
425
-
426
- ```js
427
- const dbi = require("../dbi");
428
- const Discord = require("discord.js");
122
+ ### Slash Command with Options
429
123
 
124
+ ```javascript
430
125
  dbi.register(({ ChatInput, ChatInputOptions }) => {
431
126
  ChatInput({
432
- name: "cinsiyet seç",
433
- description: "Cinsiyet seçmenizi sağlar.",
434
- onExecute({ interaction, locale }) {
435
- let gender = interaction.options.get("cinsiyet").value;
436
- let genderNames = locale.user.data.genders;
437
- let genderText = locale.user.data.genderText(interaction.user, genderNames[gender]());
438
- interaction.reply({
439
- content: genderText,
440
- components: [
441
- {
442
- type: Discord.ComponentType.ActionRow,
443
- components: [
444
- dbi.interaction("viewGender").toJSON({ overrides: { label: locale.user.data.clickText() }, reference: { ttl: 1000 * 60 * 10, data: [gender] } }),
445
- ]
446
- }
447
- ]
448
- });
449
- },
127
+ name: "greet",
128
+ description: "Greet a user",
450
129
  options: [
451
- ChatInputOptions.stringChoices({
452
- name: "cinsiyet",
453
- description: "Seçeceğiniz cinsiyet.",
454
- required: true,
455
- choices: [
456
- { name: "Erkek", value: "erkek" },
457
- { name: "Kadın", value: "kadın" },
458
- { name: "Diğer", value: "diğer" },
459
- ]
130
+ ChatInputOptions.user({
131
+ name: "target",
132
+ description: "User to greet",
133
+ required: true
134
+ }),
135
+ ChatInputOptions.string({
136
+ name: "message",
137
+ description: "Custom message"
460
138
  })
461
139
  ],
140
+ onExecute({ interaction }) {
141
+ const user = interaction.options.getUser("target");
142
+ const message = interaction.options.getString("message") || "Hello!";
143
+ interaction.reply(`${message}, ${user}!`);
144
+ }
462
145
  });
463
146
  });
464
147
  ```
465
- Genel olarak `ChatInput`'un yapısı gözünüze `options` dışında tanıdık gelmiş olabilir. Direkt olarak options içerisine bir şey doldurmaya çalıştığınızda otomatik tamamlama alamayacaksınız. Çünkü options içerisinde ChatInputOptions class'ındaki statik fonksiyonlardan beklemekte. Fonksiyonlar ise şunlara benzemekte; `stringChoices`, `user`, `numberAutocomplete` vb.
466
- Ayrıca yukarıda göstermiş olduğumuz Locale ve Component sisteminin nasıl kullanıldığıyla ilgili örnek gösterim için aşağıdan daha fazla örneğe ulaşabilirsiniz.
467
148
 
468
- # Event
149
+ ### Button with Reference Data
469
150
 
470
- <sub>`src/event.js` dosyası:</sub>
151
+ ```javascript
152
+ const Discord = require("discord.js");
471
153
 
472
- ```js
473
- const dbi = require("../dbi");
154
+ dbi.register(({ ChatInput, Button }) => {
155
+ ChatInput({
156
+ name: "shop",
157
+ description: "View the shop",
158
+ onExecute({ interaction, dbi }) {
159
+ interaction.reply({
160
+ content: "🛒 Welcome to the shop!",
161
+ components: [{
162
+ type: Discord.ComponentType.ActionRow,
163
+ components: [
164
+ dbi.interaction("buy-item").toJSON({
165
+ overrides: { label: "Buy Sword - 100g" },
166
+ reference: { data: ["sword", 100] }
167
+ })
168
+ ]
169
+ }]
170
+ });
171
+ }
172
+ });
474
173
 
475
- dbi.register(({ Event }) => {
476
- Event({
477
- name: "ready",
478
- id: "botIsReady",
479
- onExecute() {
480
- console.log(`Bot ready!`);
174
+ Button({
175
+ name: "buy-item",
176
+ options: { style: Discord.ButtonStyle.Primary },
177
+ onExecute({ interaction, data }) {
178
+ const [item, price] = data;
179
+ interaction.reply(`✅ You bought **${item}** for **${price}g**!`);
481
180
  }
482
181
  });
483
182
  });
484
183
  ```
485
- Event yani olay tanımlarken `name` kısmına istediğiniz olayın ismini yazabilirsiniz. Ancak eğer aynı olaydan birden fazla açmak istiyorsanız o olaya bir `id` tanımlamanız gerekmektedir.
486
-
487
- # Locale
488
184
 
489
- <sub>`src/locales.js` dosyası:</sub>
185
+ ### Multi-Language Support
490
186
 
491
- ```js
492
- const dbi = require("../dbi");
493
-
494
- dbi.register(({ Locale }) => {
187
+ ```javascript
188
+ dbi.register(({ Locale, ChatInput }) => {
495
189
  Locale({
496
- name: "tr",
190
+ name: "en",
497
191
  data: {
498
- genders: {
499
- erkek: "Erkek",
500
- kadın: "Kadın",
501
- diğer: "Diğer"
502
- },
503
- genderText: "{0} adlı üye {1} cinsiyetini seçti."
192
+ greeting: "Hello, {0}!",
193
+ farewell: "Goodbye!"
504
194
  }
505
195
  });
506
196
 
507
197
  Locale({
508
- name: "en",
198
+ name: "tr",
509
199
  data: {
510
- genders: {
511
- erkek: "Male",
512
- kadın: "Female",
513
- diğer: "Other"
514
- },
515
- genderText: "{0}, picked {1} gender."
200
+ greeting: "Merhaba, {0}!",
201
+ farewell: "Hoşça kal!"
202
+ }
203
+ });
204
+
205
+ ChatInput({
206
+ name: "hello",
207
+ description: "Say hello",
208
+ onExecute({ interaction, locale }) {
209
+ const greeting = locale.user.data.greeting(interaction.user.username);
210
+ interaction.reply(greeting);
516
211
  }
517
212
  });
518
213
  });
519
214
  ```
520
215
 
521
- Locale sayesinde her interaksiyon içerisinde kullanıcının veya sunucunun diline göre cevap vermenizi kolaylaştıracak bilgiler bulunmakta. Locale içerisindeki `name` hangi dil için tanımlama yaptığınız `data` kısmı ise tutmak istediğiniz değerleri içermekte. Yazı içerisindeki `{0}` ve `{1}` işaretleri aynı şekilde yazı içerisindeki değişkenlerimiz. Locale kullanırken istediğimiz değeri alıp onu bir fonksiyon gibi çağırabiliyoruz. Ve içerisine sırasıyla parametreleri veriyoruz. Örneğin `locale.data.genderText(user, gender)`.
216
+ ---
522
217
 
523
- # Button & SelectMenu & Modal
218
+ ## 📚 Documentation
524
219
 
525
- Bu bölümde ise üç adet özelliğimize bakacağız. (Aslında arka planda hepsi aynı özellik.)
220
+ Comprehensive documentation is available in the [docs](./docs/) folder:
526
221
 
527
- <sub>`src/components.js` dosyası:</sub>
222
+ | Document | Description |
223
+ |----------|-------------|
224
+ | [Getting Started](./docs/GETTING_STARTED.md) | Installation, setup, and project structure |
225
+ | [Chat Input](./docs/CHAT_INPUT.md) | Slash commands, options, and autocomplete |
226
+ | [Components](./docs/COMPONENTS.md) | Buttons, select menus, and modals |
227
+ | [Events](./docs/EVENTS.md) | Discord events, custom events, DBI events |
228
+ | [Localization](./docs/LOCALIZATION.md) | Multi-language support |
229
+ | [Advanced Features](./docs/ADVANCED_FEATURES.md) | Message commands, sharding, multi-client |
230
+ | [Svelte Components](./docs/SVELTE_COMPONENTS.md) | HTMLComponentsV2 with Svelte 5 |
231
+ | [API Reference](./docs/API_REFERENCE.md) | Complete API documentation |
528
232
 
529
- ```js
530
- const dbi = require("../dbi");
531
- const Discord = require("discord.js");
233
+ ---
532
234
 
533
- dbi.register(({ Button, SelectMenu, Modal }) => {
534
- Button({
535
- name: "viewGender",
536
- onExecute({ interaction, data }) {
537
- interaction.reply(`\`${data[0]}\``);
538
- },
539
- options: {
540
- style: Discord.ButtonStyle.Primary,
541
- label: "View Gender"
542
- }
543
- });
544
- });
235
+ ## 🏗️ Project Structure
236
+
237
+ ```
238
+ my-bot/
239
+ ├── dbi.js # DBI configuration
240
+ ├── index.js # Bot entry point
241
+ ├── publish.js # Command publisher
242
+ └── src/
243
+ ├── commands/ # Slash commands
244
+ ├── components/ # Buttons, modals, menus
245
+ ├── events/ # Event handlers
246
+ └── locales/ # Language files
545
247
  ```
546
- Button & SelectMenu & Modal hakkında çok güzel ve havalı bir özelliği sizlerle buluşturuyoruz. Artık bunların üzerinde istediğiniz değeri taşıyabilirsiniz. (Referans/Obje veya yazı/sayı gibi.) Örneğin `dbi.interaction("viewGender").toJSON("male")` bize Discord.js tarafından desteklenen geçerli bir component sunacaktır. Ve to json içerisinde sunulan değere hem `options` kısmını bir fonksiyona çevirerek ulaşabilir hem de interaksiyonun kendisi çağırıldığında ulaşabilirsiniz. Bu konuyla ilgili unutmamanız gereken bir şey var. Eğer düz yazı veya sayı taşıyacaksanız bu yazı veya sayıların toplam uzunluğu 100 karakteri geçmemeli. Çünkü bu değerler direkt olarak düğmenin üzerinde taşınmakta ve siz botu kapatıp açsanız bile orada kalacak şekilde çalışmaktadırlar.
547
248
 
548
- # MessageContextMenu & UserContextMenu
249
+ ---
549
250
 
550
- `ChatInput` ile birebir aynı özelliklere sahip ancak `options` değeri almamaktadır.
251
+ ## 🤝 Contributing
551
252
 
552
- # InteractionLocale
253
+ Contributions are welcome! Feel free to open issues or submit pull requests.
553
254
 
554
- Bir eşsiz özelliği daha sizlere sunuyoruz. Artık her kullanıcıya özel komut dili tanımlamanızı sağlayabilirsiniz.
555
- Örneğin Türk bir kullanıcıya `/cinsiyet seç` şeklinde gözüken komut yabancı bir kullanıcıya `/select gender` olarak gözükebilir. (Dilediğiniz gibi konfigüre edebilirsiniz.)
255
+ ---
556
256
 
557
- <sub>`src/interactionlocales.js` dosyası:</sub>
257
+ ## 📄 License
558
258
 
559
- ```js
560
- const dbi = require("../dbi");
259
+ [MIT](LICENSE) © TheArmagan
561
260
 
562
- dbi.register(({ InteractionLocale }) => {
563
- InteractionLocale({
564
- name: "cinsiyet seç",
565
- data: {
566
- en: {
567
- name: "select gender",
568
- description: "Allows you to select a gender.",
569
- options: {
570
- cinsiyet: {
571
- name: "gender",
572
- description: "Select your gender correctly.",
573
- choices: {
574
- "Erkek": "Male",
575
- "Kadın": "Female",
576
- "Diğer": "Other"
577
- }
578
- }
579
- }
580
- }
581
- }
582
- });
583
- });
584
- ```
261
+ ---
585
262
 
586
- Son not: `InteractionLocale` için `name` değeri sizin tanımladığınız diğer interaksiyonlardan birinin ismi olacaktır. Örneğin `cinsiyet seç`. Data'nın yapısını en basit hale getirmeye çalıştık. ilk önce istediğiniz dili seçiyorsunuz ve sonrasında içerisini örnekteki gibi uygun bir şekilde dolduruyorsunuz. İçerisine aynı anda istediğin kadar dilde nasıl gözükeceğini ekleyebilirsiniz.
263
+ <div align="center">
587
264
 
588
- Karşılacağınız hatalar ya da benzer konular için Discord üzerinden tarafıma ulaşabilirsiniz. (Armagan#4869)
265
+ **"There will always be something free and valuable on earth."**
589
266
 
590
- Unutmayın ki: "Yeryüzünde her zaman ücretsiz ve değerli bir şeyler olacaktır."
267
+ Made with ❤️ by [TheArmagan](https://github.com/TheArmagan)
591
268
 
592
- <sub>12.09.2022: Orjinal metin TheArmagan tarafından yazıldı, Maschera tarafından düzenlendi. </sub>
269
+ </div>