@depup/globalart__nestcord 2.3.1-depup.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 (392) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/changes.json +34 -0
  4. package/dist/core/index.d.ts +1 -0
  5. package/dist/core/index.js +17 -0
  6. package/dist/core/src/commands/command.discovery.d.ts +48 -0
  7. package/dist/core/src/commands/command.discovery.js +73 -0
  8. package/dist/core/src/commands/commands.module.d.ts +17 -0
  9. package/dist/core/src/commands/commands.module.js +89 -0
  10. package/dist/core/src/commands/commands.service.d.ts +35 -0
  11. package/dist/core/src/commands/commands.service.js +138 -0
  12. package/dist/core/src/commands/context-menus/context-menu.discovery.d.ts +32 -0
  13. package/dist/core/src/commands/context-menus/context-menu.discovery.js +37 -0
  14. package/dist/core/src/commands/context-menus/context-menus.module.d.ts +13 -0
  15. package/dist/core/src/commands/context-menus/context-menus.module.js +49 -0
  16. package/dist/core/src/commands/context-menus/context-menus.service.d.ts +18 -0
  17. package/dist/core/src/commands/context-menus/context-menus.service.js +46 -0
  18. package/dist/core/src/commands/context-menus/decorators/context-menu.decorator.d.ts +11 -0
  19. package/dist/core/src/commands/context-menus/decorators/context-menu.decorator.js +17 -0
  20. package/dist/core/src/commands/context-menus/decorators/index.d.ts +4 -0
  21. package/dist/core/src/commands/context-menus/decorators/index.js +20 -0
  22. package/dist/core/src/commands/context-menus/decorators/message-command.decorator.d.ts +17 -0
  23. package/dist/core/src/commands/context-menus/decorators/message-command.decorator.js +22 -0
  24. package/dist/core/src/commands/context-menus/decorators/target.decorator.d.ts +49 -0
  25. package/dist/core/src/commands/context-menus/decorators/target.decorator.js +84 -0
  26. package/dist/core/src/commands/context-menus/decorators/user-command.decorator.d.ts +18 -0
  27. package/dist/core/src/commands/context-menus/decorators/user-command.decorator.js +23 -0
  28. package/dist/core/src/commands/context-menus/index.d.ts +4 -0
  29. package/dist/core/src/commands/context-menus/index.js +20 -0
  30. package/dist/core/src/commands/index.d.ts +5 -0
  31. package/dist/core/src/commands/index.js +21 -0
  32. package/dist/core/src/commands/slash-commands/autocomplete/autocomplete.interceptor.d.ts +12 -0
  33. package/dist/core/src/commands/slash-commands/autocomplete/autocomplete.interceptor.js +43 -0
  34. package/dist/core/src/commands/slash-commands/autocomplete/index.d.ts +1 -0
  35. package/dist/core/src/commands/slash-commands/autocomplete/index.js +17 -0
  36. package/dist/core/src/commands/slash-commands/decorators/index.d.ts +3 -0
  37. package/dist/core/src/commands/slash-commands/decorators/index.js +19 -0
  38. package/dist/core/src/commands/slash-commands/decorators/slash-command.decorator.d.ts +10 -0
  39. package/dist/core/src/commands/slash-commands/decorators/slash-command.decorator.js +17 -0
  40. package/dist/core/src/commands/slash-commands/decorators/subcommand-group.decorator.d.ts +16 -0
  41. package/dist/core/src/commands/slash-commands/decorators/subcommand-group.decorator.js +33 -0
  42. package/dist/core/src/commands/slash-commands/decorators/subcommand.decorator.d.ts +8 -0
  43. package/dist/core/src/commands/slash-commands/decorators/subcommand.decorator.js +15 -0
  44. package/dist/core/src/commands/slash-commands/index.d.ts +7 -0
  45. package/dist/core/src/commands/slash-commands/index.js +23 -0
  46. package/dist/core/src/commands/slash-commands/options/attachment-option.decorator.d.ts +7 -0
  47. package/dist/core/src/commands/slash-commands/options/attachment-option.decorator.js +11 -0
  48. package/dist/core/src/commands/slash-commands/options/boolean-option.decorator.d.ts +7 -0
  49. package/dist/core/src/commands/slash-commands/options/boolean-option.decorator.js +11 -0
  50. package/dist/core/src/commands/slash-commands/options/channel-option.decorator.d.ts +7 -0
  51. package/dist/core/src/commands/slash-commands/options/channel-option.decorator.js +11 -0
  52. package/dist/core/src/commands/slash-commands/options/index.d.ts +12 -0
  53. package/dist/core/src/commands/slash-commands/options/index.js +28 -0
  54. package/dist/core/src/commands/slash-commands/options/integer-option.decorator.d.ts +7 -0
  55. package/dist/core/src/commands/slash-commands/options/integer-option.decorator.js +11 -0
  56. package/dist/core/src/commands/slash-commands/options/member-option.decorator.d.ts +7 -0
  57. package/dist/core/src/commands/slash-commands/options/member-option.decorator.js +11 -0
  58. package/dist/core/src/commands/slash-commands/options/mentionable-option.decorator.d.ts +7 -0
  59. package/dist/core/src/commands/slash-commands/options/mentionable-option.decorator.js +11 -0
  60. package/dist/core/src/commands/slash-commands/options/number-option.decorator.d.ts +7 -0
  61. package/dist/core/src/commands/slash-commands/options/number-option.decorator.js +11 -0
  62. package/dist/core/src/commands/slash-commands/options/option.util.d.ts +6 -0
  63. package/dist/core/src/commands/slash-commands/options/option.util.js +19 -0
  64. package/dist/core/src/commands/slash-commands/options/options.decorator.d.ts +7 -0
  65. package/dist/core/src/commands/slash-commands/options/options.decorator.js +35 -0
  66. package/dist/core/src/commands/slash-commands/options/role-option.decorator.d.ts +7 -0
  67. package/dist/core/src/commands/slash-commands/options/role-option.decorator.js +11 -0
  68. package/dist/core/src/commands/slash-commands/options/string-option.decorator.d.ts +7 -0
  69. package/dist/core/src/commands/slash-commands/options/string-option.decorator.js +11 -0
  70. package/dist/core/src/commands/slash-commands/options/user-option.decorator.d.ts +7 -0
  71. package/dist/core/src/commands/slash-commands/options/user-option.decorator.js +11 -0
  72. package/dist/core/src/commands/slash-commands/slash-command.discovery.d.ts +115 -0
  73. package/dist/core/src/commands/slash-commands/slash-command.discovery.js +91 -0
  74. package/dist/core/src/commands/slash-commands/slash-command.interceptors.d.ts +5 -0
  75. package/dist/core/src/commands/slash-commands/slash-command.interceptors.js +38 -0
  76. package/dist/core/src/commands/slash-commands/slash-commands.module.d.ts +13 -0
  77. package/dist/core/src/commands/slash-commands/slash-commands.module.js +50 -0
  78. package/dist/core/src/commands/slash-commands/slash-commands.service.d.ts +17 -0
  79. package/dist/core/src/commands/slash-commands/slash-commands.service.js +59 -0
  80. package/dist/core/src/context/decorators/context.decorator.d.ts +7 -0
  81. package/dist/core/src/context/decorators/context.decorator.js +12 -0
  82. package/dist/core/src/context/decorators/discovery.decorator.d.ts +6 -0
  83. package/dist/core/src/context/decorators/discovery.decorator.js +11 -0
  84. package/dist/core/src/context/decorators/index.d.ts +2 -0
  85. package/dist/core/src/context/decorators/index.js +18 -0
  86. package/dist/core/src/context/decorators/params.util.d.ts +3 -0
  87. package/dist/core/src/context/decorators/params.util.js +11 -0
  88. package/dist/core/src/context/index.d.ts +7 -0
  89. package/dist/core/src/context/index.js +23 -0
  90. package/dist/core/src/context/nestcord-arguments-host.d.ts +13 -0
  91. package/dist/core/src/context/nestcord-arguments-host.js +22 -0
  92. package/dist/core/src/context/nestcord-base.discovery.d.ts +30 -0
  93. package/dist/core/src/context/nestcord-base.discovery.js +46 -0
  94. package/dist/core/src/context/nestcord-context.interface.d.ts +15 -0
  95. package/dist/core/src/context/nestcord-context.interface.js +2 -0
  96. package/dist/core/src/context/nestcord-execution-context.d.ts +6 -0
  97. package/dist/core/src/context/nestcord-execution-context.js +13 -0
  98. package/dist/core/src/context/nestcord-params.factory.d.ts +6 -0
  99. package/dist/core/src/context/nestcord-params.factory.js +20 -0
  100. package/dist/core/src/context/nestcord-paramtype.enum.d.ts +4 -0
  101. package/dist/core/src/context/nestcord-paramtype.enum.js +8 -0
  102. package/dist/core/src/index.d.ts +13 -0
  103. package/dist/core/src/index.js +29 -0
  104. package/dist/core/src/interfaces/discord-app-asset.interface.d.ts +6 -0
  105. package/dist/core/src/interfaces/discord-app-asset.interface.js +2 -0
  106. package/dist/core/src/interfaces/index.d.ts +1 -0
  107. package/dist/core/src/interfaces/index.js +17 -0
  108. package/dist/core/src/listeners/decorators/custom-listener.decorator.d.ts +12 -0
  109. package/dist/core/src/listeners/decorators/custom-listener.decorator.js +17 -0
  110. package/dist/core/src/listeners/decorators/index.d.ts +4 -0
  111. package/dist/core/src/listeners/decorators/index.js +20 -0
  112. package/dist/core/src/listeners/decorators/listener.decorator.d.ts +7 -0
  113. package/dist/core/src/listeners/decorators/listener.decorator.js +13 -0
  114. package/dist/core/src/listeners/decorators/on.decorator.d.ts +8 -0
  115. package/dist/core/src/listeners/decorators/on.decorator.js +18 -0
  116. package/dist/core/src/listeners/decorators/once.decorator.d.ts +7 -0
  117. package/dist/core/src/listeners/decorators/once.decorator.js +17 -0
  118. package/dist/core/src/listeners/handlers/base.handler.d.ts +9 -0
  119. package/dist/core/src/listeners/handlers/base.handler.js +27 -0
  120. package/dist/core/src/listeners/handlers/channel-update.handler.d.ts +13 -0
  121. package/dist/core/src/listeners/handlers/channel-update.handler.js +33 -0
  122. package/dist/core/src/listeners/handlers/guild-audit-log-entry-create.handler.d.ts +15 -0
  123. package/dist/core/src/listeners/handlers/guild-audit-log-entry-create.handler.js +65 -0
  124. package/dist/core/src/listeners/handlers/guild-member-update.handler.d.ts +21 -0
  125. package/dist/core/src/listeners/handlers/guild-member-update.handler.js +106 -0
  126. package/dist/core/src/listeners/handlers/guild-update.handler.d.ts +26 -0
  127. package/dist/core/src/listeners/handlers/guild-update.handler.js +104 -0
  128. package/dist/core/src/listeners/handlers/index.d.ts +11 -0
  129. package/dist/core/src/listeners/handlers/index.js +27 -0
  130. package/dist/core/src/listeners/handlers/message-update.handler.d.ts +11 -0
  131. package/dist/core/src/listeners/handlers/message-update.handler.js +50 -0
  132. package/dist/core/src/listeners/handlers/presence-update.handler.d.ts +10 -0
  133. package/dist/core/src/listeners/handlers/presence-update.handler.js +39 -0
  134. package/dist/core/src/listeners/handlers/role-update.handler.d.ts +19 -0
  135. package/dist/core/src/listeners/handlers/role-update.handler.js +61 -0
  136. package/dist/core/src/listeners/handlers/thread-update.handler.d.ts +17 -0
  137. package/dist/core/src/listeners/handlers/thread-update.handler.js +77 -0
  138. package/dist/core/src/listeners/handlers/user-update.handler.d.ts +15 -0
  139. package/dist/core/src/listeners/handlers/user-update.handler.js +78 -0
  140. package/dist/core/src/listeners/handlers/voice-state-update.handler.d.ts +20 -0
  141. package/dist/core/src/listeners/handlers/voice-state-update.handler.js +85 -0
  142. package/dist/core/src/listeners/index.d.ts +5 -0
  143. package/dist/core/src/listeners/index.js +21 -0
  144. package/dist/core/src/listeners/listener.discovery.d.ts +14 -0
  145. package/dist/core/src/listeners/listener.discovery.js +22 -0
  146. package/dist/core/src/listeners/listener.interface.d.ts +3 -0
  147. package/dist/core/src/listeners/listener.interface.js +2 -0
  148. package/dist/core/src/listeners/listeners.module.d.ts +15 -0
  149. package/dist/core/src/listeners/listeners.module.js +86 -0
  150. package/dist/core/src/message-components/decorators/button.decorator.d.ts +5 -0
  151. package/dist/core/src/message-components/decorators/button.decorator.js +11 -0
  152. package/dist/core/src/message-components/decorators/component-param.decorator.d.ts +6 -0
  153. package/dist/core/src/message-components/decorators/component-param.decorator.js +23 -0
  154. package/dist/core/src/message-components/decorators/index.d.ts +5 -0
  155. package/dist/core/src/message-components/decorators/index.js +21 -0
  156. package/dist/core/src/message-components/decorators/message-component.decorator.d.ts +7 -0
  157. package/dist/core/src/message-components/decorators/message-component.decorator.js +13 -0
  158. package/dist/core/src/message-components/decorators/select-menu.decorator.d.ts +33 -0
  159. package/dist/core/src/message-components/decorators/select-menu.decorator.js +43 -0
  160. package/dist/core/src/message-components/decorators/selected.decorator.d.ts +10 -0
  161. package/dist/core/src/message-components/decorators/selected.decorator.js +40 -0
  162. package/dist/core/src/message-components/index.d.ts +4 -0
  163. package/dist/core/src/message-components/index.js +20 -0
  164. package/dist/core/src/message-components/message-component.discovery.d.ts +17 -0
  165. package/dist/core/src/message-components/message-component.discovery.js +30 -0
  166. package/dist/core/src/message-components/message-components.module.d.ts +13 -0
  167. package/dist/core/src/message-components/message-components.module.js +49 -0
  168. package/dist/core/src/message-components/message-components.service.d.ts +13 -0
  169. package/dist/core/src/message-components/message-components.service.js +46 -0
  170. package/dist/core/src/modals/decorators/fields.decorator.d.ts +6 -0
  171. package/dist/core/src/modals/decorators/fields.decorator.js +19 -0
  172. package/dist/core/src/modals/decorators/index.d.ts +3 -0
  173. package/dist/core/src/modals/decorators/index.js +19 -0
  174. package/dist/core/src/modals/decorators/modal-param.decorator.d.ts +5 -0
  175. package/dist/core/src/modals/decorators/modal-param.decorator.js +22 -0
  176. package/dist/core/src/modals/decorators/modal.decorator.d.ts +6 -0
  177. package/dist/core/src/modals/decorators/modal.decorator.js +12 -0
  178. package/dist/core/src/modals/index.d.ts +4 -0
  179. package/dist/core/src/modals/index.js +20 -0
  180. package/dist/core/src/modals/modal.discovery.d.ts +15 -0
  181. package/dist/core/src/modals/modal.discovery.js +27 -0
  182. package/dist/core/src/modals/modals.module.d.ts +13 -0
  183. package/dist/core/src/modals/modals.module.js +47 -0
  184. package/dist/core/src/modals/modals.service.d.ts +12 -0
  185. package/dist/core/src/modals/modals.service.js +43 -0
  186. package/dist/core/src/nestcord-explorer.service.d.ts +20 -0
  187. package/dist/core/src/nestcord-explorer.service.js +72 -0
  188. package/dist/core/src/nestcord-options.interface.d.ts +41 -0
  189. package/dist/core/src/nestcord-options.interface.js +2 -0
  190. package/dist/core/src/nestcord.consts.d.ts +1 -0
  191. package/dist/core/src/nestcord.consts.js +4 -0
  192. package/dist/core/src/nestcord.module-definition.d.ts +2 -0
  193. package/dist/core/src/nestcord.module-definition.js +9 -0
  194. package/dist/core/src/nestcord.module.d.ts +11 -0
  195. package/dist/core/src/nestcord.module.js +69 -0
  196. package/dist/core/src/nestcord.service.d.ts +33 -0
  197. package/dist/core/src/nestcord.service.js +136 -0
  198. package/dist/core/src/providers/channels.provider.d.ts +3 -0
  199. package/dist/core/src/providers/channels.provider.js +9 -0
  200. package/dist/core/src/providers/client.provider.d.ts +3 -0
  201. package/dist/core/src/providers/client.provider.js +26 -0
  202. package/dist/core/src/providers/guilds.provider.d.ts +3 -0
  203. package/dist/core/src/providers/guilds.provider.js +9 -0
  204. package/dist/core/src/providers/index.d.ts +8 -0
  205. package/dist/core/src/providers/index.js +24 -0
  206. package/dist/core/src/providers/rest.provider.d.ts +3 -0
  207. package/dist/core/src/providers/rest.provider.js +9 -0
  208. package/dist/core/src/providers/shard.provider.d.ts +3 -0
  209. package/dist/core/src/providers/shard.provider.js +9 -0
  210. package/dist/core/src/providers/users.provider.d.ts +3 -0
  211. package/dist/core/src/providers/users.provider.js +9 -0
  212. package/dist/core/src/providers/voice.provider.d.ts +3 -0
  213. package/dist/core/src/providers/voice.provider.js +9 -0
  214. package/dist/core/src/providers/ws.provider.d.ts +3 -0
  215. package/dist/core/src/providers/ws.provider.js +9 -0
  216. package/dist/core/src/services/proxy.service.d.ts +19 -0
  217. package/dist/core/src/services/proxy.service.js +69 -0
  218. package/dist/core/src/text-commands/decorators/arguments.decorator.d.ts +6 -0
  219. package/dist/core/src/text-commands/decorators/arguments.decorator.js +19 -0
  220. package/dist/core/src/text-commands/decorators/index.d.ts +2 -0
  221. package/dist/core/src/text-commands/decorators/index.js +18 -0
  222. package/dist/core/src/text-commands/decorators/text-command.decorator.d.ts +6 -0
  223. package/dist/core/src/text-commands/decorators/text-command.decorator.js +12 -0
  224. package/dist/core/src/text-commands/index.d.ts +4 -0
  225. package/dist/core/src/text-commands/index.js +20 -0
  226. package/dist/core/src/text-commands/text-command.discovery.d.ts +14 -0
  227. package/dist/core/src/text-commands/text-command.discovery.js +22 -0
  228. package/dist/core/src/text-commands/text-commands.module.d.ts +15 -0
  229. package/dist/core/src/text-commands/text-commands.module.js +74 -0
  230. package/dist/core/src/text-commands/text-commands.service.d.ts +12 -0
  231. package/dist/core/src/text-commands/text-commands.service.js +38 -0
  232. package/dist/index.d.ts +5 -0
  233. package/dist/index.js +21 -0
  234. package/dist/lavalink/index.d.ts +1 -0
  235. package/dist/lavalink/index.js +17 -0
  236. package/dist/lavalink/src/context/index.d.ts +1 -0
  237. package/dist/lavalink/src/context/index.js +17 -0
  238. package/dist/lavalink/src/context/lavalink-context.interface.d.ts +3 -0
  239. package/dist/lavalink/src/context/lavalink-context.interface.js +2 -0
  240. package/dist/lavalink/src/helpers/index.d.ts +1 -0
  241. package/dist/lavalink/src/helpers/index.js +17 -0
  242. package/dist/lavalink/src/helpers/player-manager.d.ts +9 -0
  243. package/dist/lavalink/src/helpers/player-manager.js +32 -0
  244. package/dist/lavalink/src/index.d.ts +8 -0
  245. package/dist/lavalink/src/index.js +24 -0
  246. package/dist/lavalink/src/listeners/decorators/index.d.ts +3 -0
  247. package/dist/lavalink/src/listeners/decorators/index.js +19 -0
  248. package/dist/lavalink/src/listeners/decorators/listener.decorator.d.ts +7 -0
  249. package/dist/lavalink/src/listeners/decorators/listener.decorator.js +12 -0
  250. package/dist/lavalink/src/listeners/decorators/on.decorator.d.ts +13 -0
  251. package/dist/lavalink/src/listeners/decorators/on.decorator.js +23 -0
  252. package/dist/lavalink/src/listeners/decorators/once.decorator.d.ts +13 -0
  253. package/dist/lavalink/src/listeners/decorators/once.decorator.js +27 -0
  254. package/dist/lavalink/src/listeners/enums/index.d.ts +2 -0
  255. package/dist/lavalink/src/listeners/enums/index.js +18 -0
  256. package/dist/lavalink/src/listeners/enums/listener-host-type.enum.d.ts +4 -0
  257. package/dist/lavalink/src/listeners/enums/listener-host-type.enum.js +8 -0
  258. package/dist/lavalink/src/listeners/enums/listener-type.enum.d.ts +4 -0
  259. package/dist/lavalink/src/listeners/enums/listener-type.enum.js +8 -0
  260. package/dist/lavalink/src/listeners/index.d.ts +4 -0
  261. package/dist/lavalink/src/listeners/index.js +20 -0
  262. package/dist/lavalink/src/listeners/interfaces/index.d.ts +2 -0
  263. package/dist/lavalink/src/listeners/interfaces/index.js +18 -0
  264. package/dist/lavalink/src/listeners/interfaces/listener-events.interface.d.ts +8 -0
  265. package/dist/lavalink/src/listeners/interfaces/listener-events.interface.js +2 -0
  266. package/dist/lavalink/src/listeners/interfaces/listener-meta.interface.d.ts +7 -0
  267. package/dist/lavalink/src/listeners/interfaces/listener-meta.interface.js +2 -0
  268. package/dist/lavalink/src/listeners/listeners.module.d.ts +12 -0
  269. package/dist/lavalink/src/listeners/listeners.module.js +81 -0
  270. package/dist/lavalink/src/nestcord-lavalink-options.interface.d.ts +4 -0
  271. package/dist/lavalink/src/nestcord-lavalink-options.interface.js +2 -0
  272. package/dist/lavalink/src/nestcord-lavalink.module-definition.d.ts +2 -0
  273. package/dist/lavalink/src/nestcord-lavalink.module-definition.js +9 -0
  274. package/dist/lavalink/src/nestcord-lavalink.module.d.ts +15 -0
  275. package/dist/lavalink/src/nestcord-lavalink.module.js +79 -0
  276. package/dist/lavalink/src/nestcord-lavalink.service.d.ts +18 -0
  277. package/dist/lavalink/src/nestcord-lavalink.service.js +59 -0
  278. package/dist/lavalink/src/providers/index.d.ts +3 -0
  279. package/dist/lavalink/src/providers/index.js +19 -0
  280. package/dist/lavalink/src/providers/lavalink-manager.provider.d.ts +3 -0
  281. package/dist/lavalink/src/providers/lavalink-manager.provider.js +22 -0
  282. package/dist/lavalink/src/providers/node-manager.provider.d.ts +3 -0
  283. package/dist/lavalink/src/providers/node-manager.provider.js +9 -0
  284. package/dist/lavalink/src/providers/player.provider.d.ts +3 -0
  285. package/dist/lavalink/src/providers/player.provider.js +10 -0
  286. package/dist/localization/index.d.ts +1 -0
  287. package/dist/localization/index.js +17 -0
  288. package/dist/localization/src/adapters/base-localization.adapter.d.ts +6 -0
  289. package/dist/localization/src/adapters/base-localization.adapter.js +9 -0
  290. package/dist/localization/src/adapters/default-localization.adapter.d.ts +14 -0
  291. package/dist/localization/src/adapters/default-localization.adapter.js +31 -0
  292. package/dist/localization/src/adapters/index.d.ts +3 -0
  293. package/dist/localization/src/adapters/index.js +19 -0
  294. package/dist/localization/src/adapters/nested-localization.adapter.d.ts +16 -0
  295. package/dist/localization/src/adapters/nested-localization.adapter.js +41 -0
  296. package/dist/localization/src/decorators/current-translate.decorator.d.ts +1 -0
  297. package/dist/localization/src/decorators/current-translate.decorator.js +6 -0
  298. package/dist/localization/src/decorators/index.d.ts +1 -0
  299. package/dist/localization/src/decorators/index.js +17 -0
  300. package/dist/localization/src/index.d.ts +9 -0
  301. package/dist/localization/src/index.js +25 -0
  302. package/dist/localization/src/interceptors/index.d.ts +1 -0
  303. package/dist/localization/src/interceptors/index.js +17 -0
  304. package/dist/localization/src/interceptors/localization.interceptor.d.ts +19 -0
  305. package/dist/localization/src/interceptors/localization.interceptor.js +106 -0
  306. package/dist/localization/src/interfaces/command-contex.interface.d.ts +2 -0
  307. package/dist/localization/src/interfaces/command-contex.interface.js +2 -0
  308. package/dist/localization/src/interfaces/index.d.ts +4 -0
  309. package/dist/localization/src/interfaces/index.js +20 -0
  310. package/dist/localization/src/interfaces/locale-resolver.interface.d.ts +4 -0
  311. package/dist/localization/src/interfaces/locale-resolver.interface.js +2 -0
  312. package/dist/localization/src/interfaces/nestcord-localization-options.interface.d.ts +8 -0
  313. package/dist/localization/src/interfaces/nestcord-localization-options.interface.js +2 -0
  314. package/dist/localization/src/interfaces/translate-function.interface.d.ts +1 -0
  315. package/dist/localization/src/interfaces/translate-function.interface.js +2 -0
  316. package/dist/localization/src/nestcord-localization.module-definition.d.ts +2 -0
  317. package/dist/localization/src/nestcord-localization.module-definition.js +31 -0
  318. package/dist/localization/src/nestcord-localization.module.d.ts +3 -0
  319. package/dist/localization/src/nestcord-localization.module.js +24 -0
  320. package/dist/localization/src/nestcord-localization.service.d.ts +13 -0
  321. package/dist/localization/src/nestcord-localization.service.js +97 -0
  322. package/dist/localization/src/providers/index.d.ts +2 -0
  323. package/dist/localization/src/providers/index.js +18 -0
  324. package/dist/localization/src/providers/localization-adapter.provider.d.ts +1 -0
  325. package/dist/localization/src/providers/localization-adapter.provider.js +4 -0
  326. package/dist/localization/src/providers/localization-resolvers.provider.d.ts +1 -0
  327. package/dist/localization/src/providers/localization-resolvers.provider.js +4 -0
  328. package/dist/localization/src/resolvers/guild.resolver.d.ts +5 -0
  329. package/dist/localization/src/resolvers/guild.resolver.js +22 -0
  330. package/dist/localization/src/resolvers/index.d.ts +2 -0
  331. package/dist/localization/src/resolvers/index.js +18 -0
  332. package/dist/localization/src/resolvers/user.resolver.d.ts +5 -0
  333. package/dist/localization/src/resolvers/user.resolver.js +22 -0
  334. package/dist/localization/src/utils/index.d.ts +1 -0
  335. package/dist/localization/src/utils/index.js +17 -0
  336. package/dist/localization/src/utils/localization-map-by-key.util.d.ts +2 -0
  337. package/dist/localization/src/utils/localization-map-by-key.util.js +17 -0
  338. package/dist/pagination/index.d.ts +1 -0
  339. package/dist/pagination/index.js +17 -0
  340. package/dist/pagination/src/builders/base-pagination.builder.d.ts +9 -0
  341. package/dist/pagination/src/builders/base-pagination.builder.js +13 -0
  342. package/dist/pagination/src/builders/buttons-padgination.builder.d.ts +20 -0
  343. package/dist/pagination/src/builders/buttons-padgination.builder.js +82 -0
  344. package/dist/pagination/src/builders/index.d.ts +3 -0
  345. package/dist/pagination/src/builders/index.js +19 -0
  346. package/dist/pagination/src/builders/page.builder.d.ts +14 -0
  347. package/dist/pagination/src/builders/page.builder.js +44 -0
  348. package/dist/pagination/src/builders/select-menu-pagination.builder.d.ts +18 -0
  349. package/dist/pagination/src/builders/select-menu-pagination.builder.js +53 -0
  350. package/dist/pagination/src/enums/index.d.ts +1 -0
  351. package/dist/pagination/src/enums/index.js +17 -0
  352. package/dist/pagination/src/enums/pagination-action.enum.d.ts +11 -0
  353. package/dist/pagination/src/enums/pagination-action.enum.js +16 -0
  354. package/dist/pagination/src/exceptions/index.d.ts +2 -0
  355. package/dist/pagination/src/exceptions/index.js +18 -0
  356. package/dist/pagination/src/exceptions/pagination-forbidden.exception.d.ts +4 -0
  357. package/dist/pagination/src/exceptions/pagination-forbidden.exception.js +10 -0
  358. package/dist/pagination/src/exceptions/pagination-not-found.exception.d.ts +4 -0
  359. package/dist/pagination/src/exceptions/pagination-not-found.exception.js +10 -0
  360. package/dist/pagination/src/index.d.ts +7 -0
  361. package/dist/pagination/src/index.js +23 -0
  362. package/dist/pagination/src/interfaces/index.d.ts +1 -0
  363. package/dist/pagination/src/interfaces/index.js +17 -0
  364. package/dist/pagination/src/interfaces/nestcord-pagination-options.interface.d.ts +28 -0
  365. package/dist/pagination/src/interfaces/nestcord-pagination-options.interface.js +2 -0
  366. package/dist/pagination/src/nestcord-pagination.module-definition.d.ts +2 -0
  367. package/dist/pagination/src/nestcord-pagination.module-definition.js +9 -0
  368. package/dist/pagination/src/nestcord-pagination.module.d.ts +6 -0
  369. package/dist/pagination/src/nestcord-pagination.module.js +36 -0
  370. package/dist/pagination/src/nestcord-pagination.service.d.ts +11 -0
  371. package/dist/pagination/src/nestcord-pagination.service.js +54 -0
  372. package/dist/pagination/src/types/paginator-builder.type.d.ts +4 -0
  373. package/dist/pagination/src/types/paginator-builder.type.js +2 -0
  374. package/dist/stat-reporter/index.d.ts +1 -0
  375. package/dist/stat-reporter/index.js +17 -0
  376. package/dist/stat-reporter/src/enums/index.d.ts +1 -0
  377. package/dist/stat-reporter/src/enums/index.js +17 -0
  378. package/dist/stat-reporter/src/enums/stat-cron-epxression.enum.d.ts +62 -0
  379. package/dist/stat-reporter/src/enums/stat-cron-epxression.enum.js +66 -0
  380. package/dist/stat-reporter/src/index.d.ts +5 -0
  381. package/dist/stat-reporter/src/index.js +21 -0
  382. package/dist/stat-reporter/src/interfaces/index.d.ts +1 -0
  383. package/dist/stat-reporter/src/interfaces/index.js +17 -0
  384. package/dist/stat-reporter/src/interfaces/nestcord-stat-reporter-options.interface.d.ts +60 -0
  385. package/dist/stat-reporter/src/interfaces/nestcord-stat-reporter-options.interface.js +2 -0
  386. package/dist/stat-reporter/src/nestcord-stat-reporter.module-definition.d.ts +2 -0
  387. package/dist/stat-reporter/src/nestcord-stat-reporter.module-definition.js +9 -0
  388. package/dist/stat-reporter/src/nestcord-stat-reporter.module.d.ts +3 -0
  389. package/dist/stat-reporter/src/nestcord-stat-reporter.module.js +25 -0
  390. package/dist/stat-reporter/src/nestcord-stat-reporter.service.d.ts +22 -0
  391. package/dist/stat-reporter/src/nestcord-stat-reporter.service.js +118 -0
  392. package/package.json +137 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2003 GlobalArt Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @depup/globalart__nestcord
2
+
3
+ > Dependency-bumped version of [@globalart/nestcord](https://www.npmjs.com/package/@globalart/nestcord)
4
+
5
+ Generated by [DepUp](https://github.com/depup/npm) -- all production
6
+ dependencies bumped to latest versions.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @depup/globalart__nestcord
12
+ ```
13
+
14
+ | Field | Value |
15
+ |-------|-------|
16
+ | Original | [@globalart/nestcord](https://www.npmjs.com/package/@globalart/nestcord) @ 2.3.1 |
17
+ | Processed | 2026-03-22 |
18
+ | Smoke test | failed |
19
+ | Deps updated | 7 |
20
+
21
+ ## Dependency Changes
22
+
23
+ | Dependency | From | To |
24
+ |------------|------|-----|
25
+ | @globalart/text-utils | ^1.0.4 | ^1.0.6 |
26
+ | @nestjs/axios | ^4.0.0 | ^4.0.1 |
27
+ | @nestjs/schedule | ^6.0.0 | ^6.1.1 |
28
+ | axios | ^1.9.0 | ^1.13.6 |
29
+ | cron | 4.3.0 | ^4.4.0 |
30
+ | lavalink-client | ^2.5.3 | ^2.9.9 |
31
+ | path-to-regexp | ^8.0.0 | ^8.3.0 |
32
+
33
+ ---
34
+
35
+ Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/@globalart/nestcord
36
+
37
+ License inherited from the original package.
package/changes.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "bumped": {
3
+ "@globalart/text-utils": {
4
+ "from": "^1.0.4",
5
+ "to": "^1.0.6"
6
+ },
7
+ "@nestjs/axios": {
8
+ "from": "^4.0.0",
9
+ "to": "^4.0.1"
10
+ },
11
+ "@nestjs/schedule": {
12
+ "from": "^6.0.0",
13
+ "to": "^6.1.1"
14
+ },
15
+ "axios": {
16
+ "from": "^1.9.0",
17
+ "to": "^1.13.6"
18
+ },
19
+ "cron": {
20
+ "from": "4.3.0",
21
+ "to": "^4.4.0"
22
+ },
23
+ "lavalink-client": {
24
+ "from": "^2.5.3",
25
+ "to": "^2.9.9"
26
+ },
27
+ "path-to-regexp": {
28
+ "from": "^8.0.0",
29
+ "to": "^8.3.0"
30
+ }
31
+ },
32
+ "timestamp": "2026-03-22T00:37:39.553Z",
33
+ "totalUpdated": 7
34
+ }
@@ -0,0 +1 @@
1
+ export * from './src';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src"), exports);
@@ -0,0 +1,48 @@
1
+ import { ApplicationCommand, BaseApplicationCommandData, Collection, Snowflake } from 'discord.js';
2
+ import { NestCordBaseDiscovery } from '../context';
3
+ export interface BaseCommandMeta extends BaseApplicationCommandData {
4
+ guilds?: Snowflake[];
5
+ category?: string;
6
+ discordResponse?: ApplicationCommand;
7
+ }
8
+ /**
9
+ * Represents a command discovery.
10
+ * @abstract
11
+ */
12
+ export declare abstract class CommandDiscovery<T extends BaseCommandMeta = BaseCommandMeta> extends NestCordBaseDiscovery<T> {
13
+ /**
14
+ * Return the command ID
15
+ */
16
+ getId(): string;
17
+ /**
18
+ * Return the discord response of command
19
+ */
20
+ getDiscordResponse(): ApplicationCommand<{}>;
21
+ /**
22
+ * Returns the command name.
23
+ */
24
+ getName(): string;
25
+ /**
26
+ * Get command category
27
+ */
28
+ getCategory(): string | undefined;
29
+ /**
30
+ * Sets the command guilds for register.
31
+ * @param guilds
32
+ */
33
+ setGuilds(guilds: Snowflake[]): void;
34
+ /**
35
+ * Checks if the command has a guild.
36
+ * @param guild
37
+ */
38
+ hasGuild(guild: Snowflake): boolean;
39
+ /**
40
+ * Returns the guilds.
41
+ */
42
+ getGuilds(): Snowflake[] | undefined;
43
+ /**
44
+ * Get sub commands
45
+ */
46
+ getSubCommands(): Collection<string, CommandDiscovery>;
47
+ hasSubCommands(): boolean;
48
+ }
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommandDiscovery = void 0;
4
+ const discord_js_1 = require("discord.js");
5
+ const context_1 = require("../context");
6
+ /**
7
+ * Represents a command discovery.
8
+ * @abstract
9
+ */
10
+ class CommandDiscovery extends context_1.NestCordBaseDiscovery {
11
+ /**
12
+ * Return the command ID
13
+ */
14
+ getId() {
15
+ var _a;
16
+ return (_a = this.meta.discordResponse) === null || _a === void 0 ? void 0 : _a.id;
17
+ }
18
+ /**
19
+ * Return the discord response of command
20
+ */
21
+ getDiscordResponse() {
22
+ return this.meta.discordResponse;
23
+ }
24
+ /**
25
+ * Returns the command name.
26
+ */
27
+ getName() {
28
+ return this.meta.name;
29
+ }
30
+ /**
31
+ * Get command category
32
+ */
33
+ getCategory() {
34
+ return this.meta.category;
35
+ }
36
+ /**
37
+ * Sets the command guilds for register.
38
+ * @param guilds
39
+ */
40
+ setGuilds(guilds) {
41
+ this.meta.guilds = guilds;
42
+ }
43
+ /**
44
+ * Checks if the command has a guild.
45
+ * @param guild
46
+ */
47
+ hasGuild(guild) {
48
+ var _a, _b;
49
+ return (_b = (_a = this.meta.guilds) === null || _a === void 0 ? void 0 : _a.includes(guild)) !== null && _b !== void 0 ? _b : false;
50
+ }
51
+ /**
52
+ * Returns the guilds.
53
+ */
54
+ getGuilds() {
55
+ return this.meta.guilds;
56
+ }
57
+ /**
58
+ * Get sub commands
59
+ */
60
+ getSubCommands() {
61
+ if (this.isSlashCommand()) {
62
+ return this.subcommands;
63
+ }
64
+ return new discord_js_1.Collection();
65
+ }
66
+ hasSubCommands() {
67
+ if (this.isSlashCommand()) {
68
+ return this.subcommands.size > 0;
69
+ }
70
+ return false;
71
+ }
72
+ }
73
+ exports.CommandDiscovery = CommandDiscovery;
@@ -0,0 +1,17 @@
1
+ import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
2
+ import { ContextMenusService } from './context-menus';
3
+ import { SlashCommandsService } from './slash-commands';
4
+ import { CommandsService } from './commands.service';
5
+ import { Client } from 'discord.js';
6
+ import { NestCordModuleOptions } from '../nestcord-options.interface';
7
+ export declare class CommandsModule implements OnModuleInit, OnApplicationBootstrap {
8
+ private readonly client;
9
+ private readonly options;
10
+ private readonly commandsService;
11
+ private readonly contextMenusService;
12
+ private readonly slashCommandsService;
13
+ constructor(client: Client, options: NestCordModuleOptions, commandsService: CommandsService, contextMenusService: ContextMenusService, slashCommandsService: SlashCommandsService);
14
+ onModuleInit(): Promise<void>;
15
+ private initializeClient;
16
+ onApplicationBootstrap(): void;
17
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.CommandsModule = void 0;
25
+ const common_1 = require("@nestjs/common");
26
+ const context_menus_1 = require("./context-menus");
27
+ const slash_commands_1 = require("./slash-commands");
28
+ const commands_service_1 = require("./commands.service");
29
+ const discord_js_1 = require("discord.js");
30
+ const nestcord_module_definition_1 = require("../nestcord.module-definition");
31
+ let CommandsModule = class CommandsModule {
32
+ constructor(client, options, commandsService, contextMenusService, slashCommandsService) {
33
+ this.client = client;
34
+ this.options = options;
35
+ this.commandsService = commandsService;
36
+ this.contextMenusService = contextMenusService;
37
+ this.slashCommandsService = slashCommandsService;
38
+ }
39
+ onModuleInit() {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ this.client.once('ready', () => __awaiter(this, void 0, void 0, function* () {
42
+ yield this.initializeClient();
43
+ }));
44
+ });
45
+ }
46
+ initializeClient() {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const { skipGetCommandInfoFromDiscord, skipRegistration } = this.options;
49
+ if (!skipGetCommandInfoFromDiscord) {
50
+ yield this.client.application.commands.fetch();
51
+ this.commandsService.getAllCommandsAndSetDiscordResponseMeta();
52
+ }
53
+ if (!skipRegistration) {
54
+ if (this.client.application.partial) {
55
+ yield this.client.application.fetch();
56
+ }
57
+ yield this.commandsService.registerAllCommands();
58
+ if (!skipGetCommandInfoFromDiscord) {
59
+ this.commandsService.getAllCommandsAndSetDiscordResponseMeta();
60
+ }
61
+ }
62
+ });
63
+ }
64
+ onApplicationBootstrap() {
65
+ const commands = [
66
+ ...this.contextMenusService.cache.values(),
67
+ ...this.slashCommandsService.cache.values(),
68
+ ];
69
+ commands.forEach((command) => {
70
+ const guilds = Array.isArray(this.options.development)
71
+ ? this.options.development
72
+ : command.getGuilds() || [undefined];
73
+ command.setGuilds(guilds);
74
+ });
75
+ }
76
+ };
77
+ exports.CommandsModule = CommandsModule;
78
+ exports.CommandsModule = CommandsModule = __decorate([
79
+ (0, common_1.Global)(),
80
+ (0, common_1.Module)({
81
+ imports: [context_menus_1.ContextMenusModule, slash_commands_1.SlashCommandsModule],
82
+ providers: [commands_service_1.CommandsService],
83
+ exports: [context_menus_1.ContextMenusModule, slash_commands_1.SlashCommandsModule, commands_service_1.CommandsService],
84
+ }),
85
+ __param(1, (0, common_1.Inject)(nestcord_module_definition_1.NESTCORD_MODULE_OPTIONS)),
86
+ __metadata("design:paramtypes", [discord_js_1.Client, Object, commands_service_1.CommandsService,
87
+ context_menus_1.ContextMenusService,
88
+ slash_commands_1.SlashCommandsService])
89
+ ], CommandsModule);
@@ -0,0 +1,35 @@
1
+ import { Client, Collection } from 'discord.js';
2
+ import { CommandDiscovery } from './command.discovery';
3
+ import { ContextMenusService } from './context-menus';
4
+ import { SlashCommandsService } from './slash-commands';
5
+ /**
6
+ * Represents a service that manages commands.
7
+ */
8
+ export declare class CommandsService {
9
+ private readonly client;
10
+ private readonly contextMenusService;
11
+ private readonly slashCommandsService;
12
+ private readonly logger;
13
+ constructor(client: Client, contextMenusService: ContextMenusService, slashCommandsService: SlashCommandsService);
14
+ /**
15
+ * Registers all commands.
16
+ *
17
+ */
18
+ registerAllCommands(): Promise<void>;
19
+ /**
20
+ * Registers commands in a guild.
21
+ * @param guildId
22
+ */
23
+ registerInGuild(guildId: string): Promise<void | Collection<string, import("discord.js").ApplicationCommand<{}>>>;
24
+ getCommands(): CommandDiscovery[];
25
+ getCommandsByGuilds(): Collection<string, CommandDiscovery[]>;
26
+ getCommandsByCategoryMap(): Map<string, CommandDiscovery[]>;
27
+ getCommandsMap(): Map<string, CommandDiscovery>;
28
+ getGuildCommandsMap(guildId: string): Map<string, CommandDiscovery<import("./command.discovery").BaseCommandMeta>>;
29
+ getCommandByName(name: string): CommandDiscovery;
30
+ getGlobalCommands(): CommandDiscovery[];
31
+ getGlobalCommandByName(name: string): CommandDiscovery;
32
+ getGuildCommands(guildId: string): CommandDiscovery[];
33
+ getGuildCommandByName(guildId: string, name: string): CommandDiscovery;
34
+ getAllCommandsAndSetDiscordResponseMeta(): void;
35
+ }
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ var CommandsService_1;
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.CommandsService = void 0;
23
+ const common_1 = require("@nestjs/common");
24
+ const discord_js_1 = require("discord.js");
25
+ const context_menus_1 = require("./context-menus");
26
+ const slash_commands_1 = require("./slash-commands");
27
+ /**
28
+ * Represents a service that manages commands.
29
+ */
30
+ let CommandsService = CommandsService_1 = class CommandsService {
31
+ constructor(client, contextMenusService, slashCommandsService) {
32
+ this.client = client;
33
+ this.contextMenusService = contextMenusService;
34
+ this.slashCommandsService = slashCommandsService;
35
+ this.logger = new common_1.Logger(CommandsService_1.name);
36
+ }
37
+ /**
38
+ * Registers all commands.
39
+ *
40
+ */
41
+ registerAllCommands() {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const guilds = new Set(this.getCommandsByGuilds().keys());
44
+ this.logger.log(`Started refreshing application commands.`);
45
+ for (const guild of guilds) {
46
+ yield this.registerInGuild(guild);
47
+ }
48
+ this.logger.log(`Successfully reloaded application commands.`);
49
+ });
50
+ }
51
+ /**
52
+ * Registers commands in a guild.
53
+ * @param guildId
54
+ */
55
+ registerInGuild(guildId) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const commands = this.getGuildCommands(guildId);
58
+ if (commands.length === 0) {
59
+ this.logger.log(`Skipping ${guildId ? `guild ${guildId}` : 'global'} as it has no commands.`);
60
+ return;
61
+ }
62
+ const rawCommands = commands.flatMap((command) => command.toJSON());
63
+ return this.client.application.commands.set(rawCommands, guildId).catch((error) => {
64
+ this.logger.error(`Failed to register application commands (${guildId ? `in guild ${guildId}` : 'global'}): ${error}`, error.stack);
65
+ });
66
+ });
67
+ }
68
+ getCommands() {
69
+ return [...this.contextMenusService.cache.values(), ...this.slashCommandsService.cache.values()].flat();
70
+ }
71
+ getCommandsByGuilds() {
72
+ const collection = new discord_js_1.Collection();
73
+ const commands = this.getCommands();
74
+ for (const command of commands) {
75
+ for (const guildId of command.getGuilds()) {
76
+ const visitedCommands = collection.get(guildId) || [];
77
+ collection.set(guildId, visitedCommands.concat(command));
78
+ }
79
+ }
80
+ return collection;
81
+ }
82
+ getCommandsByCategoryMap() {
83
+ return this.getCommands().reduce((map, command) => {
84
+ const category = command.meta.category || 'no_group';
85
+ if (!map.has(category)) {
86
+ map.set(category, []);
87
+ }
88
+ map.get(category).push(command);
89
+ return map;
90
+ }, new Map());
91
+ }
92
+ getCommandsMap() {
93
+ return this.getCommands().reduce((map, command) => {
94
+ map.set(command.getName(), command);
95
+ return map;
96
+ }, new Map());
97
+ }
98
+ getGuildCommandsMap(guildId) {
99
+ return this.getGuildCommands(guildId).reduce((map, command) => {
100
+ map.set(command.getName(), command);
101
+ return map;
102
+ }, new Map());
103
+ }
104
+ getCommandByName(name) {
105
+ return this.getCommands().find((command) => command.getName() === name);
106
+ }
107
+ getGlobalCommands() {
108
+ return this.getCommandsByGuilds().get(undefined) || [];
109
+ }
110
+ getGlobalCommandByName(name) {
111
+ return this.getCommandsMap().get(name);
112
+ }
113
+ getGuildCommands(guildId) {
114
+ return this.getCommandsByGuilds().get(guildId) || [];
115
+ }
116
+ getGuildCommandByName(guildId, name) {
117
+ return this.getGuildCommandsMap(guildId).get(name);
118
+ }
119
+ getAllCommandsAndSetDiscordResponseMeta() {
120
+ const commands = this.getCommandsMap();
121
+ const commandsCache = this.client.application.commands.cache;
122
+ const matchingCommands = Array.from(commandsCache.values()).filter((command) => commands.has(command.name));
123
+ for (const command of matchingCommands) {
124
+ const commandByName = commands.get(command.name);
125
+ if (commandByName.meta) {
126
+ commandByName.meta.discordResponse = command;
127
+ }
128
+ this.slashCommandsService.update(commandByName);
129
+ }
130
+ }
131
+ };
132
+ exports.CommandsService = CommandsService;
133
+ exports.CommandsService = CommandsService = CommandsService_1 = __decorate([
134
+ (0, common_1.Injectable)(),
135
+ __metadata("design:paramtypes", [discord_js_1.Client,
136
+ context_menus_1.ContextMenusService,
137
+ slash_commands_1.SlashCommandsService])
138
+ ], CommandsService);
@@ -0,0 +1,32 @@
1
+ import { ContextMenuCommandInteraction, MessageApplicationCommandData, Snowflake, UserApplicationCommandData } from 'discord.js';
2
+ import { CommandDiscovery } from '../command.discovery';
3
+ /**
4
+ * The context menu metadata.
5
+ */
6
+ export type ContextMenuMeta = (MessageApplicationCommandData | UserApplicationCommandData) & {
7
+ guilds?: Snowflake[];
8
+ };
9
+ /**
10
+ * The context menu discovery.
11
+ * @see CommandDiscovery
12
+ * @see ContextMenuMeta
13
+ */
14
+ export declare class ContextMenuDiscovery extends CommandDiscovery<ContextMenuMeta> {
15
+ /**
16
+ * Gets the discovery type.
17
+ */
18
+ getType(): import("discord.js").ApplicationCommandType.User | import("discord.js").ApplicationCommandType.Message;
19
+ /**
20
+ * Type guard for the context menu discovery.
21
+ */
22
+ isContextMenu(): this is ContextMenuDiscovery;
23
+ /**
24
+ * Executes the context menu discovery.
25
+ * @param interaction The interaction to execute.
26
+ */
27
+ execute(interaction: ContextMenuCommandInteraction): unknown;
28
+ /**
29
+ * Converts the context menu discovery to JSON.
30
+ */
31
+ toJSON(): ContextMenuMeta;
32
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContextMenuDiscovery = void 0;
4
+ const command_discovery_1 = require("../command.discovery");
5
+ /**
6
+ * The context menu discovery.
7
+ * @see CommandDiscovery
8
+ * @see ContextMenuMeta
9
+ */
10
+ class ContextMenuDiscovery extends command_discovery_1.CommandDiscovery {
11
+ /**
12
+ * Gets the discovery type.
13
+ */
14
+ getType() {
15
+ return this.meta.type;
16
+ }
17
+ /**
18
+ * Type guard for the context menu discovery.
19
+ */
20
+ isContextMenu() {
21
+ return true;
22
+ }
23
+ /**
24
+ * Executes the context menu discovery.
25
+ * @param interaction The interaction to execute.
26
+ */
27
+ execute(interaction) {
28
+ return super.execute([interaction]);
29
+ }
30
+ /**
31
+ * Converts the context menu discovery to JSON.
32
+ */
33
+ toJSON() {
34
+ return this.meta;
35
+ }
36
+ }
37
+ exports.ContextMenuDiscovery = ContextMenuDiscovery;
@@ -0,0 +1,13 @@
1
+ import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
2
+ import { ContextMenusService } from './context-menus.service';
3
+ import { ExplorerService } from '../../nestcord-explorer.service';
4
+ import { ContextMenuDiscovery } from './context-menu.discovery';
5
+ import { Client } from 'discord.js';
6
+ export declare class ContextMenusModule implements OnModuleInit, OnApplicationBootstrap {
7
+ private readonly client;
8
+ private readonly explorerService;
9
+ private readonly contextMenusService;
10
+ constructor(client: Client, explorerService: ExplorerService<ContextMenuDiscovery>, contextMenusService: ContextMenusService);
11
+ onModuleInit(): void;
12
+ onApplicationBootstrap(): Client<boolean>;
13
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContextMenusModule = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const context_menus_service_1 = require("./context-menus.service");
15
+ const nestcord_explorer_service_1 = require("../../nestcord-explorer.service");
16
+ const discord_js_1 = require("discord.js");
17
+ const decorators_1 = require("./decorators");
18
+ let ContextMenusModule = class ContextMenusModule {
19
+ constructor(client, explorerService, contextMenusService) {
20
+ this.client = client;
21
+ this.explorerService = explorerService;
22
+ this.contextMenusService = contextMenusService;
23
+ }
24
+ onModuleInit() {
25
+ return this.explorerService
26
+ .explore(decorators_1.ContextMenu.KEY)
27
+ .forEach((contextMenu) => this.contextMenusService.add(contextMenu));
28
+ }
29
+ onApplicationBootstrap() {
30
+ return this.client.on('interactionCreate', (interaction) => {
31
+ var _a;
32
+ if (!interaction.isContextMenuCommand()) {
33
+ return;
34
+ }
35
+ return (_a = this.contextMenusService.get(interaction.commandType, interaction.commandName)) === null || _a === void 0 ? void 0 : _a.execute(interaction);
36
+ });
37
+ }
38
+ };
39
+ exports.ContextMenusModule = ContextMenusModule;
40
+ exports.ContextMenusModule = ContextMenusModule = __decorate([
41
+ (0, common_1.Global)(),
42
+ (0, common_1.Module)({
43
+ providers: [context_menus_service_1.ContextMenusService],
44
+ exports: [context_menus_service_1.ContextMenusService],
45
+ }),
46
+ __metadata("design:paramtypes", [discord_js_1.Client,
47
+ nestcord_explorer_service_1.ExplorerService,
48
+ context_menus_service_1.ContextMenusService])
49
+ ], ContextMenusModule);
@@ -0,0 +1,18 @@
1
+ import { Collection } from 'discord.js';
2
+ import { ContextMenuDiscovery, ContextMenuMeta } from './context-menu.discovery';
3
+ /**
4
+ * Service that manages context menus.
5
+ * @see ContextMenuDiscovery
6
+ * @see ContextMenuMeta
7
+ * @see ContextMenu
8
+ * @see MessageCommand
9
+ * @see UserCommand
10
+ */
11
+ export declare class ContextMenusService {
12
+ private readonly logger;
13
+ readonly cache: Collection<string, ContextMenuDiscovery>;
14
+ add(contextMenu: ContextMenuDiscovery): void;
15
+ get(type: ContextMenuMeta['type'], name: ContextMenuMeta['name']): ContextMenuDiscovery;
16
+ remove(type: ContextMenuMeta['type'], name: ContextMenuMeta['name']): boolean;
17
+ private getId;
18
+ }