@pikokr/command.ts 4.0.0 → 4.0.2-dev.4f3e456

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 (211) hide show
  1. package/.github/workflows/docs.yml +79 -0
  2. package/.github/workflows/publish.stable.yml +18 -0
  3. package/dist/index.d.ts +310 -10
  4. package/dist/index.js +1 -22
  5. package/dist/index.js.map +1 -1
  6. package/docs/index.yml +5 -0
  7. package/package.json +10 -5
  8. package/publish-version.js +7 -3
  9. package/scripts/docs.ts +11 -0
  10. package/src/applicationCommand/AppCommand.ts +4 -0
  11. package/src/applicationCommand/decorator.ts +4 -0
  12. package/src/applicationCommand/index.ts +4 -0
  13. package/src/builtinModules/BuiltInModule.ts +4 -0
  14. package/src/builtinModules/BuiltinApplicationCommandConverters.ts +4 -0
  15. package/src/builtinModules/BuiltinCommandConverters.ts +4 -0
  16. package/src/builtinModules/CommandHandler.ts +4 -0
  17. package/src/builtinModules/index.ts +4 -0
  18. package/src/command/ArgumentConverter.ts +4 -0
  19. package/src/command/Command.ts +4 -0
  20. package/src/command/cooldown/adapter.ts +4 -0
  21. package/src/command/cooldown/decorator.ts +4 -0
  22. package/src/command/cooldown/error.ts +4 -0
  23. package/src/command/cooldown/index.ts +4 -0
  24. package/src/command/cooldown/type.ts +4 -0
  25. package/src/command/decorator.ts +4 -0
  26. package/src/command/index.ts +4 -0
  27. package/src/command/utils.ts +4 -0
  28. package/src/constants.ts +4 -0
  29. package/src/error/ArgumentConverterNotFound.ts +4 -0
  30. package/src/error/ArgumentNotProvided.ts +4 -0
  31. package/src/error/CommandCheckFailed.ts +4 -0
  32. package/src/error/CommandNotFound.ts +4 -0
  33. package/src/error/InvalidTargetError.ts +4 -0
  34. package/src/error/ModuleError.ts +4 -0
  35. package/src/error/PermissionRequired.ts +4 -0
  36. package/src/error/checks/DMOnlyCommand.ts +4 -0
  37. package/src/error/checks/GuildOnlyCommand.ts +4 -0
  38. package/src/error/checks/OwnerOnlyCommand.ts +4 -0
  39. package/src/error/checks/SlashCommandGlobalCheckError.ts +4 -0
  40. package/src/error/checks/index.ts +4 -0
  41. package/src/error/index.ts +4 -0
  42. package/src/index.ts +4 -0
  43. package/src/interface/index.ts +4 -0
  44. package/src/listener/Listener.ts +4 -0
  45. package/src/listener/decorator.ts +4 -0
  46. package/src/listener/index.ts +4 -0
  47. package/src/messageComponents/base.ts +4 -0
  48. package/src/messageComponents/button.ts +4 -0
  49. package/src/messageComponents/index.ts +4 -0
  50. package/src/messageComponents/selectMenu.ts +4 -0
  51. package/src/structures/CommandClient.ts +4 -0
  52. package/src/structures/Module.ts +4 -0
  53. package/src/structures/Registry.ts +34 -12
  54. package/src/structures/index.ts +4 -0
  55. package/src/typings.ts +4 -0
  56. package/src/utils.ts +4 -0
  57. package/test/index.ts +4 -0
  58. package/test/modules/dev.ts +5 -0
  59. package/test/modules/test.ts +5 -1
  60. package/tsconfig.json +1 -1
  61. package/tsup.config.ts +14 -0
  62. package/dist/applicationCommand/AppCommand.d.ts +0 -18
  63. package/dist/applicationCommand/AppCommand.js +0 -22
  64. package/dist/applicationCommand/AppCommand.js.map +0 -1
  65. package/dist/applicationCommand/decorator.d.ts +0 -10
  66. package/dist/applicationCommand/decorator.js +0 -39
  67. package/dist/applicationCommand/decorator.js.map +0 -1
  68. package/dist/applicationCommand/index.d.ts +0 -2
  69. package/dist/applicationCommand/index.js +0 -15
  70. package/dist/applicationCommand/index.js.map +0 -1
  71. package/dist/builtinModules/BuiltInModule.d.ts +0 -4
  72. package/dist/builtinModules/BuiltInModule.js +0 -13
  73. package/dist/builtinModules/BuiltInModule.js.map +0 -1
  74. package/dist/builtinModules/BuiltinApplicationCommandConverters.d.ts +0 -8
  75. package/dist/builtinModules/BuiltinApplicationCommandConverters.js +0 -13
  76. package/dist/builtinModules/BuiltinApplicationCommandConverters.js.map +0 -1
  77. package/dist/builtinModules/BuiltinCommandConverters.d.ts +0 -16
  78. package/dist/builtinModules/BuiltinCommandConverters.js +0 -127
  79. package/dist/builtinModules/BuiltinCommandConverters.js.map +0 -1
  80. package/dist/builtinModules/BuiltinSlashCommandConverters.d.ts +0 -10
  81. package/dist/builtinModules/BuiltinSlashCommandConverters.js +0 -42
  82. package/dist/builtinModules/BuiltinSlashCommandConverters.js.map +0 -1
  83. package/dist/builtinModules/CommandHandler.d.ts +0 -14
  84. package/dist/builtinModules/CommandHandler.js +0 -357
  85. package/dist/builtinModules/CommandHandler.js.map +0 -1
  86. package/dist/builtinModules/index.d.ts +0 -3
  87. package/dist/builtinModules/index.js +0 -16
  88. package/dist/builtinModules/index.js.map +0 -1
  89. package/dist/command/ArgumentConverter.d.ts +0 -15
  90. package/dist/command/ArgumentConverter.js +0 -25
  91. package/dist/command/ArgumentConverter.js.map +0 -1
  92. package/dist/command/Command.d.ts +0 -20
  93. package/dist/command/Command.js +0 -22
  94. package/dist/command/Command.js.map +0 -1
  95. package/dist/command/cooldown/adapter.d.ts +0 -10
  96. package/dist/command/cooldown/adapter.js +0 -31
  97. package/dist/command/cooldown/adapter.js.map +0 -1
  98. package/dist/command/cooldown/decorator.d.ts +0 -2
  99. package/dist/command/cooldown/decorator.js +0 -73
  100. package/dist/command/cooldown/decorator.js.map +0 -1
  101. package/dist/command/cooldown/error.d.ts +0 -4
  102. package/dist/command/cooldown/error.js +0 -11
  103. package/dist/command/cooldown/error.js.map +0 -1
  104. package/dist/command/cooldown/index.d.ts +0 -5
  105. package/dist/command/cooldown/index.js +0 -18
  106. package/dist/command/cooldown/index.js.map +0 -1
  107. package/dist/command/cooldown/type.d.ts +0 -8
  108. package/dist/command/cooldown/type.js +0 -13
  109. package/dist/command/cooldown/type.js.map +0 -1
  110. package/dist/command/decorator.d.ts +0 -17
  111. package/dist/command/decorator.js +0 -138
  112. package/dist/command/decorator.js.map +0 -1
  113. package/dist/command/index.d.ts +0 -5
  114. package/dist/command/index.js +0 -18
  115. package/dist/command/index.js.map +0 -1
  116. package/dist/command/utils.d.ts +0 -2
  117. package/dist/command/utils.js +0 -30
  118. package/dist/command/utils.js.map +0 -1
  119. package/dist/constants.d.ts +0 -14
  120. package/dist/constants.js +0 -18
  121. package/dist/constants.js.map +0 -1
  122. package/dist/error/ArgumentConverterNotFound.d.ts +0 -13
  123. package/dist/error/ArgumentConverterNotFound.js +0 -20
  124. package/dist/error/ArgumentConverterNotFound.js.map +0 -1
  125. package/dist/error/ArgumentNotProvided.d.ts +0 -8
  126. package/dist/error/ArgumentNotProvided.js +0 -13
  127. package/dist/error/ArgumentNotProvided.js.map +0 -1
  128. package/dist/error/CommandCheckFailed.d.ts +0 -13
  129. package/dist/error/CommandCheckFailed.js +0 -20
  130. package/dist/error/CommandCheckFailed.js.map +0 -1
  131. package/dist/error/CommandNotFound.d.ts +0 -7
  132. package/dist/error/CommandNotFound.js +0 -13
  133. package/dist/error/CommandNotFound.js.map +0 -1
  134. package/dist/error/InvalidTargetError.d.ts +0 -3
  135. package/dist/error/InvalidTargetError.js +0 -10
  136. package/dist/error/InvalidTargetError.js.map +0 -1
  137. package/dist/error/ModuleError.d.ts +0 -6
  138. package/dist/error/ModuleError.js +0 -14
  139. package/dist/error/ModuleError.js.map +0 -1
  140. package/dist/error/PermissionRequired.d.ts +0 -10
  141. package/dist/error/PermissionRequired.js +0 -19
  142. package/dist/error/PermissionRequired.js.map +0 -1
  143. package/dist/error/checks/DMOnlyCommand.d.ts +0 -3
  144. package/dist/error/checks/DMOnlyCommand.js +0 -10
  145. package/dist/error/checks/DMOnlyCommand.js.map +0 -1
  146. package/dist/error/checks/GuildOnlyCommand.d.ts +0 -3
  147. package/dist/error/checks/GuildOnlyCommand.js +0 -10
  148. package/dist/error/checks/GuildOnlyCommand.js.map +0 -1
  149. package/dist/error/checks/OwnerOnlyCommand.d.ts +0 -3
  150. package/dist/error/checks/OwnerOnlyCommand.js +0 -10
  151. package/dist/error/checks/OwnerOnlyCommand.js.map +0 -1
  152. package/dist/error/checks/SlashCommandGlobalCheckError.d.ts +0 -5
  153. package/dist/error/checks/SlashCommandGlobalCheckError.js +0 -11
  154. package/dist/error/checks/SlashCommandGlobalCheckError.js.map +0 -1
  155. package/dist/error/checks/index.d.ts +0 -3
  156. package/dist/error/checks/index.js +0 -16
  157. package/dist/error/checks/index.js.map +0 -1
  158. package/dist/error/index.d.ts +0 -7
  159. package/dist/error/index.js +0 -20
  160. package/dist/error/index.js.map +0 -1
  161. package/dist/interface/index.d.ts +0 -1
  162. package/dist/interface/index.js +0 -4
  163. package/dist/interface/index.js.map +0 -1
  164. package/dist/listener/Listener.d.ts +0 -5
  165. package/dist/listener/Listener.js +0 -11
  166. package/dist/listener/Listener.js.map +0 -1
  167. package/dist/listener/decorator.d.ts +0 -2
  168. package/dist/listener/decorator.js +0 -22
  169. package/dist/listener/decorator.js.map +0 -1
  170. package/dist/listener/index.d.ts +0 -2
  171. package/dist/listener/index.js +0 -15
  172. package/dist/listener/index.js.map +0 -1
  173. package/dist/messageComponents/base.d.ts +0 -10
  174. package/dist/messageComponents/base.js +0 -15
  175. package/dist/messageComponents/base.js.map +0 -1
  176. package/dist/messageComponents/button.d.ts +0 -5
  177. package/dist/messageComponents/button.js +0 -28
  178. package/dist/messageComponents/button.js.map +0 -1
  179. package/dist/messageComponents/index.d.ts +0 -2
  180. package/dist/messageComponents/index.js +0 -15
  181. package/dist/messageComponents/index.js.map +0 -1
  182. package/dist/messageComponents/selectMenu.d.ts +0 -5
  183. package/dist/messageComponents/selectMenu.js +0 -28
  184. package/dist/messageComponents/selectMenu.js.map +0 -1
  185. package/dist/slashCommand/SlashCommand.d.ts +0 -19
  186. package/dist/slashCommand/SlashCommand.js +0 -22
  187. package/dist/slashCommand/SlashCommand.js.map +0 -1
  188. package/dist/slashCommand/decorator.d.ts +0 -11
  189. package/dist/slashCommand/decorator.js +0 -39
  190. package/dist/slashCommand/decorator.js.map +0 -1
  191. package/dist/slashCommand/index.d.ts +0 -2
  192. package/dist/slashCommand/index.js +0 -15
  193. package/dist/slashCommand/index.js.map +0 -1
  194. package/dist/structures/CommandClient.d.ts +0 -45
  195. package/dist/structures/CommandClient.js +0 -94
  196. package/dist/structures/CommandClient.js.map +0 -1
  197. package/dist/structures/Module.d.ts +0 -21
  198. package/dist/structures/Module.js +0 -38
  199. package/dist/structures/Module.js.map +0 -1
  200. package/dist/structures/Registry.d.ts +0 -30
  201. package/dist/structures/Registry.js +0 -226
  202. package/dist/structures/Registry.js.map +0 -1
  203. package/dist/structures/index.d.ts +0 -3
  204. package/dist/structures/index.js +0 -16
  205. package/dist/structures/index.js.map +0 -1
  206. package/dist/typings.d.ts +0 -30
  207. package/dist/typings.js +0 -3
  208. package/dist/typings.js.map +0 -1
  209. package/dist/utils.d.ts +0 -1
  210. package/dist/utils.js +0 -11
  211. package/dist/utils.js.map +0 -1
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
1
5
  import { MessageComponentExecutor, MessageComponentHandler } from './base'
2
6
  import { checkTarget } from '../utils'
3
7
  import { KMessageComponentHandlers } from '../constants'
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
1
5
  import _ from 'lodash'
2
6
  import { Registry } from './Registry'
3
7
  import { Client, CommandInteraction, Interaction, Message, Snowflake, User } from 'discord.js'
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
1
5
  import { KArgumentConverters, KCommands, KListeners, KMessageComponentHandlers, KModulePath, KSlashArgumentConverters, KApplicationCommands } from '../constants'
2
6
  import type { Command } from '../command'
3
7
  import { Listener } from '../listener'
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
1
5
  import { CommandClient } from './CommandClient'
2
6
  import { Module } from './Module'
3
7
  import { Command, ApplicationCommandArgumentConverter } from '../command'
@@ -140,28 +144,46 @@ export class Registry {
140
144
  this.logger.debug(`Syncing commands...`)
141
145
  const commands = this.applicationCommands.filter((x) => !x.guild)
142
146
  const guild = this.client.options.applicationCommands.guild
147
+ const syncForGuild = async (g: Guild, commands: AppCommand[]) => {
148
+ this.logger.debug(`Syncing for guild ${g.name}(${g.id})`)
149
+ const commandsToRegister = commands.map((x) => x.command)
150
+ this.logger.debug(`Command List: ${commandsToRegister.map((x) => x.name).join(', ')}`)
151
+ await g.commands.set(commandsToRegister)
152
+ }
143
153
  if (guild) {
144
- const syncForGuild = async (g: Guild) => {
145
- this.logger.debug(`Syncing for guild ${g.name}(${g.id})`)
146
- const commandsToRegister = [
147
- ...commands.map((x) => x.command),
148
- ...this.applicationCommands.filter((y) => y.guild === g.id || y.guild?.includes(g.id) || false).map((x) => x.command),
149
- ]
150
- this.logger.debug(`Command List: ${commandsToRegister.map((x) => x.name).join(', ')}`)
151
- await g.commands.set(commandsToRegister)
152
- }
153
-
154
154
  if (typeof guild === 'string') {
155
- await syncForGuild(await this.client.client.guilds.fetch(guild))
155
+ await syncForGuild(await this.client.client.guilds.fetch(guild), commands)
156
156
  } else {
157
157
  for (const g of guild) {
158
- await syncForGuild(await this.client.client.guilds.fetch(g))
158
+ await syncForGuild(await this.client.client.guilds.fetch(g), commands)
159
159
  }
160
160
  }
161
161
  } else {
162
162
  this.logger.debug('Syncing global...')
163
163
  await this.client.client.application?.commands.set(commands.map((x) => x.command))
164
164
  }
165
+ const commandsWithGuild = this.applicationCommands.filter((x) => !!x.guild)
166
+
167
+ const guilds = new Set<string>()
168
+
169
+ for (const command of commandsWithGuild) {
170
+ if (!command.guild) continue
171
+ if (typeof command.guild === 'string') {
172
+ guilds.add(command.guild)
173
+ } else {
174
+ for (const guild of command.guild) {
175
+ guilds.add(guild)
176
+ }
177
+ }
178
+ }
179
+
180
+ for (const guild of guilds) {
181
+ await syncForGuild(
182
+ await this.client.client.guilds.fetch(guild),
183
+ commandsWithGuild.filter((x) => x.guild && (typeof x.guild === 'string' ? guild === x.guild : x.guild.includes(guild))),
184
+ )
185
+ }
186
+
165
187
  this.logger.debug('Syncing ended.')
166
188
  }
167
189
 
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
1
5
  export * from './Module'
2
6
  export * from './CommandClient'
3
7
  export * from './Registry'
package/src/typings.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
1
5
  import type { Command } from './command'
2
6
  import { CommandClient } from './structures'
3
7
  import { AppCommand } from './applicationCommand'
package/src/utils.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
1
5
  import { Module } from './structures'
2
6
  import { InvalidTargetError } from './error'
3
7
 
package/test/index.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
1
5
  import { Client, Intents, IntentsString } from 'discord.js'
2
6
  import { CommandClient } from '../src'
3
7
 
@@ -1,3 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
1
5
  import { BuiltInModule, CommandClient, ownerOnly, applicationCommand, listener, ApplicationCommandCheckFailed } from '../../src'
2
6
  import { CommandInteraction } from 'discord.js'
3
7
 
@@ -24,6 +28,7 @@ export class Dev extends BuiltInModule {
24
28
  type: 'CHAT_INPUT',
25
29
  description: '리로드 커맨드',
26
30
  },
31
+ guild: ['457841749197586438'],
27
32
  })
28
33
  @ownerOnly
29
34
  async reload(i: CommandInteraction) {
@@ -1,4 +1,8 @@
1
- import { command, CommandClient, coolDown, CoolDownError, CoolDownType, listener, messageButton, messageSelectMenu, Module, option, rest, applicationCommand } from '../../src'
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
5
+ import { CommandClient, coolDown, CoolDownError, CoolDownType, listener, messageButton, messageSelectMenu, Module, option, applicationCommand } from '../../src'
2
6
  import {
3
7
  ButtonInteraction,
4
8
  CommandInteraction,
package/tsconfig.json CHANGED
@@ -79,5 +79,5 @@
79
79
  "forceConsistentCasingInFileNames": true
80
80
  /* Disallow inconsistently-cased references to the same file. */
81
81
  },
82
- "exclude": ["test", "node_modules", "dist"]
82
+ "exclude": ["test", "node_modules", "dist", "tsup.config.ts", "scripts"]
83
83
  }
package/tsup.config.ts ADDED
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
5
+ import { defineConfig } from 'tsup'
6
+
7
+ export default defineConfig({
8
+ entry: ['src/index.ts'],
9
+ sourcemap: true,
10
+ splitting: false,
11
+ clean: true,
12
+ dts: true,
13
+ minify: true,
14
+ })
@@ -1,18 +0,0 @@
1
- import { Module } from '../structures';
2
- import { ApplicationCommandDataResolvable, Snowflake } from 'discord.js';
3
- import { ApplicationCommandCheckFunction } from '../command';
4
- export declare type AppCommandArgument = {
5
- type: any;
6
- name?: string;
7
- };
8
- export declare class AppCommand {
9
- command: ApplicationCommandDataResolvable;
10
- private run;
11
- module: Module;
12
- params: AppCommandArgument[];
13
- guild: Snowflake | Snowflake[] | undefined;
14
- private key;
15
- get checks(): ApplicationCommandCheckFunction[];
16
- execute(module: Module, args: any[]): any;
17
- constructor(command: ApplicationCommandDataResolvable, run: Function, module: Module, params: AppCommandArgument[], guild: Snowflake | Snowflake[] | undefined, key: string | symbol);
18
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppCommand = void 0;
4
- const constants_1 = require("../constants");
5
- class AppCommand {
6
- constructor(command, run, module, params, guild, key) {
7
- this.command = command;
8
- this.run = run;
9
- this.module = module;
10
- this.params = params;
11
- this.guild = guild;
12
- this.key = key;
13
- }
14
- get checks() {
15
- return Reflect.getMetadata(constants_1.KApplicationCommandChecks, this.module, this.key) || [];
16
- }
17
- execute(module, args) {
18
- return this.run.apply(module, args);
19
- }
20
- }
21
- exports.AppCommand = AppCommand;
22
- //# sourceMappingURL=AppCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AppCommand.js","sourceRoot":"","sources":["../../src/applicationCommand/AppCommand.ts"],"names":[],"mappings":";;;AAEA,4CAAwD;AAQxD,MAAa,UAAU;IASrB,YACS,OAAyC,EACxC,GAAa,EACd,MAAc,EACd,MAA4B,EAC5B,KAA0C,EACzC,GAAoB;QALrB,YAAO,GAAP,OAAO,CAAkC;QACxC,QAAG,GAAH,GAAG,CAAU;QACd,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAsB;QAC5B,UAAK,GAAL,KAAK,CAAqC;QACzC,QAAG,GAAH,GAAG,CAAiB;IAC3B,CAAC;IAfJ,IAAI,MAAM;QACR,OAAO,OAAO,CAAC,WAAW,CAAC,qCAAyB,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IACpF,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,IAAW;QACjC,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IACrC,CAAC;CAUF;AAjBD,gCAiBC"}
@@ -1,10 +0,0 @@
1
- import { ApplicationCommandDataResolvable, Snowflake } from 'discord.js';
2
- declare type ApplicationCommandOptions = {
3
- guild: Snowflake | Snowflake[];
4
- optionTypes?: any[];
5
- };
6
- export declare const applicationCommand: (opt: Partial<ApplicationCommandOptions> & {
7
- command: ApplicationCommandDataResolvable;
8
- }) => (target: Object, propertyKey: string) => void;
9
- export declare const option: (key: string) => ParameterDecorator;
10
- export {};
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.option = exports.applicationCommand = void 0;
4
- const discord_js_1 = require("discord.js");
5
- const utils_1 = require("../utils");
6
- const constants_1 = require("../constants");
7
- const AppCommand_1 = require("./AppCommand");
8
- const applicationCommand = (opt) => {
9
- return (target, propertyKey) => {
10
- var _a;
11
- utils_1.checkTarget(target);
12
- let properties = Reflect.getMetadata(constants_1.KApplicationCommands, target);
13
- const params = (_a = opt.optionTypes) !== null && _a !== void 0 ? _a : Reflect.getMetadata('design:paramtypes', target, propertyKey);
14
- const options = Reflect.getMetadata(constants_1.KSlashCommandOptions, target, propertyKey) || new discord_js_1.Collection();
15
- const command = new AppCommand_1.AppCommand(opt.command, Reflect.get(target, propertyKey), target, params.map((x, i) => ({
16
- type: x,
17
- name: options.get(i),
18
- })), opt.guild, propertyKey);
19
- if (properties) {
20
- properties.push(command);
21
- }
22
- else {
23
- properties = [command];
24
- Reflect.defineMetadata(constants_1.KApplicationCommands, properties, target);
25
- }
26
- };
27
- };
28
- exports.applicationCommand = applicationCommand;
29
- const option = (key) => (target, propertyKey, parameterIndex) => {
30
- utils_1.checkTarget(target);
31
- let properties = Reflect.getMetadata(constants_1.KSlashCommandOptions, target, propertyKey);
32
- if (!properties) {
33
- properties = new discord_js_1.Collection();
34
- Reflect.defineMetadata(constants_1.KSlashCommandOptions, properties, target, propertyKey);
35
- }
36
- properties.set(parameterIndex, key);
37
- };
38
- exports.option = option;
39
- //# sourceMappingURL=decorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../src/applicationCommand/decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAoF;AACpF,oCAAsC;AACtC,4CAAyE;AAEzE,6CAAyC;AAOlC,MAAM,kBAAkB,GAAG,CAAC,GAAuF,EAAE,EAAE;IAC5H,OAAO,CACL,MAAc,EACd,WAAmB,EAEnB,EAAE;;QACF,mBAAW,CAAC,MAAM,CAAC,CAAA;QAEnB,IAAI,UAAU,GAAiB,OAAO,CAAC,WAAW,CAAC,gCAAoB,EAAE,MAAM,CAAC,CAAA;QAEhF,MAAM,MAAM,GAAU,MAAA,GAAG,CAAC,WAAW,mCAAI,OAAO,CAAC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AAc,EAAE,GAAG,CAAC,CAAA;AACrC,CAAC,CAAA;AAXY,QAAA,MAAM,UAWlB"}
@@ -1,2 +0,0 @@
1
- export * from './decorator';
2
- export * from './AppCommand';
@@ -1,15 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./decorator"), exports);
14
- __exportStar(require("./AppCommand"), exports);
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/applicationCommand/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA2B;AAC3B,+CAA4B"}
@@ -1,4 +0,0 @@
1
- import { Module } from '../structures';
2
- export declare class BuiltInModule extends Module {
3
- constructor();
4
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuiltInModule = void 0;
4
- const structures_1 = require("../structures");
5
- const constants_1 = require("../constants");
6
- class BuiltInModule extends structures_1.Module {
7
- constructor() {
8
- super();
9
- Reflect.defineMetadata(constants_1.KBuiltInModule, true, this);
10
- }
11
- }
12
- exports.BuiltInModule = BuiltInModule;
13
- //# sourceMappingURL=BuiltInModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BuiltInModule.js","sourceRoot":"","sources":["../../src/builtinModules/BuiltInModule.ts"],"names":[],"mappings":";;;AAAA,8CAAsC;AACtC,4CAA6C;AAE7C,MAAa,aAAc,SAAQ,mBAAM;IACvC;QACE,KAAK,EAAE,CAAA;QACP,OAAO,CAAC,cAAc,CAAC,0BAAc,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACpD,CAAC;CACF;AALD,sCAKC"}
@@ -1,8 +0,0 @@
1
- import { BuiltInModule } from './BuiltInModule';
2
- import { Client } from 'discord.js';
3
- import { CommandClient } from '../structures';
4
- export declare class BuiltinApplicationCommandConverters extends BuiltInModule {
5
- private cts;
6
- client: Client;
7
- constructor(cts: CommandClient);
8
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuiltinApplicationCommandConverters = void 0;
4
- const BuiltInModule_1 = require("./BuiltInModule");
5
- class BuiltinApplicationCommandConverters extends BuiltInModule_1.BuiltInModule {
6
- constructor(cts) {
7
- super();
8
- this.cts = cts;
9
- this.client = cts.client;
10
- }
11
- }
12
- exports.BuiltinApplicationCommandConverters = BuiltinApplicationCommandConverters;
13
- //# sourceMappingURL=BuiltinApplicationCommandConverters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BuiltinApplicationCommandConverters.js","sourceRoot":"","sources":["../../src/builtinModules/BuiltinApplicationCommandConverters.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAI/C,MAAa,mCAAoC,SAAQ,6BAAa;IAGpE,YAAoB,GAAkB;QACpC,KAAK,EAAE,CAAA;QADW,QAAG,GAAH,GAAG,CAAe;QAEpC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;IAC1B,CAAC;CACF;AAPD,kFAOC"}
@@ -1,16 +0,0 @@
1
- import { BuiltInModule } from './BuiltInModule';
2
- import { Client, GuildMember, Message, User, Role } from 'discord.js';
3
- import { CommandClient } from '../structures';
4
- export declare class BuiltinCommandConverters extends BuiltInModule {
5
- private cts;
6
- client: Client;
7
- constructor(cts: CommandClient);
8
- message(msg: Message): Message<boolean>;
9
- string(msg: Message, arg: string): string;
10
- getUserIDByMention(mention: string): `${bigint}` | undefined;
11
- user(msg: Message, value: string): User | null;
12
- member(msg: Message, value: string): GuildMember | undefined;
13
- number(msg: Message, value: string): number | undefined;
14
- getRoleIDByMention(mention: string): `${bigint}` | undefined;
15
- role(msg: Message, value: string): Role | undefined;
16
- }
@@ -1,127 +0,0 @@
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.BuiltinCommandConverters = void 0;
13
- const BuiltInModule_1 = require("./BuiltInModule");
14
- const command_1 = require("../command");
15
- const discord_js_1 = require("discord.js");
16
- class BuiltinCommandConverters extends BuiltInModule_1.BuiltInModule {
17
- constructor(cts) {
18
- super();
19
- this.cts = cts;
20
- this.client = cts.client;
21
- }
22
- message(msg) {
23
- return msg;
24
- }
25
- string(msg, arg) {
26
- return arg;
27
- }
28
- getUserIDByMention(mention) {
29
- if (!mention)
30
- return;
31
- if (mention.startsWith('<@') && mention.endsWith('>')) {
32
- mention = mention.slice(2, -1);
33
- if (mention.startsWith('!')) {
34
- mention = mention.slice(1);
35
- }
36
- return mention;
37
- }
38
- }
39
- user(msg, value) {
40
- let user = this.client.users.cache.get(value);
41
- if (user)
42
- return user;
43
- user = this.client.users.cache.find((x) => x.tag === value || x.username === value);
44
- if (user)
45
- return user;
46
- const id = this.getUserIDByMention(value);
47
- if (!id)
48
- return null;
49
- user = this.client.users.cache.get(id);
50
- return user || null;
51
- }
52
- member(msg, value) {
53
- var _a, _b, _c;
54
- let user = (_a = msg.guild) === null || _a === void 0 ? void 0 : _a.members.cache.get(value);
55
- if (!user)
56
- return user;
57
- user = (_b = msg.guild) === null || _b === void 0 ? void 0 : _b.members.cache.find((x) => x.user.tag === value);
58
- if (user)
59
- return user;
60
- const id = this.getUserIDByMention(value);
61
- if (!id)
62
- return;
63
- user = (_c = msg.guild) === null || _c === void 0 ? void 0 : _c.members.cache.get(id);
64
- return user || undefined;
65
- }
66
- number(msg, value) {
67
- const n = Number(value);
68
- return isNaN(n) ? undefined : n;
69
- }
70
- getRoleIDByMention(mention) {
71
- if (!mention)
72
- return;
73
- if (mention.startsWith('<@') && mention.endsWith('>')) {
74
- mention = mention.slice(2, -1);
75
- if (mention.startsWith('&')) {
76
- mention = mention.slice(1);
77
- }
78
- return mention;
79
- }
80
- }
81
- role(msg, value) {
82
- var _a;
83
- const id = this.getRoleIDByMention(value);
84
- if (!id)
85
- return;
86
- const role = (_a = msg.guild) === null || _a === void 0 ? void 0 : _a.roles.cache.get(id);
87
- return role || undefined;
88
- }
89
- }
90
- __decorate([
91
- command_1.argumentConverter(discord_js_1.Message, false),
92
- __metadata("design:type", Function),
93
- __metadata("design:paramtypes", [discord_js_1.Message]),
94
- __metadata("design:returntype", void 0)
95
- ], BuiltinCommandConverters.prototype, "message", null);
96
- __decorate([
97
- command_1.argumentConverter(String),
98
- __metadata("design:type", Function),
99
- __metadata("design:paramtypes", [discord_js_1.Message, String]),
100
- __metadata("design:returntype", void 0)
101
- ], BuiltinCommandConverters.prototype, "string", null);
102
- __decorate([
103
- command_1.argumentConverter(discord_js_1.User),
104
- __metadata("design:type", Function),
105
- __metadata("design:paramtypes", [discord_js_1.Message, String]),
106
- __metadata("design:returntype", Object)
107
- ], BuiltinCommandConverters.prototype, "user", null);
108
- __decorate([
109
- command_1.argumentConverter(discord_js_1.GuildMember),
110
- __metadata("design:type", Function),
111
- __metadata("design:paramtypes", [discord_js_1.Message, String]),
112
- __metadata("design:returntype", Object)
113
- ], BuiltinCommandConverters.prototype, "member", null);
114
- __decorate([
115
- command_1.argumentConverter(Number),
116
- __metadata("design:type", Function),
117
- __metadata("design:paramtypes", [discord_js_1.Message, String]),
118
- __metadata("design:returntype", void 0)
119
- ], BuiltinCommandConverters.prototype, "number", null);
120
- __decorate([
121
- command_1.argumentConverter(discord_js_1.Role),
122
- __metadata("design:type", Function),
123
- __metadata("design:paramtypes", [discord_js_1.Message, String]),
124
- __metadata("design:returntype", Object)
125
- ], BuiltinCommandConverters.prototype, "role", null);
126
- exports.BuiltinCommandConverters = BuiltinCommandConverters;
127
- //# sourceMappingURL=BuiltinCommandConverters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BuiltinCommandConverters.js","sourceRoot":"","sources":["../../src/builtinModules/BuiltinCommandConverters.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAA+C;AAC/C,wCAA8C;AAC9C,2CAAqE;AAGrE,MAAa,wBAAyB,SAAQ,6BAAa;IAGzD,YAAoB,GAAkB;QACpC,KAAK,EAAE,CAAA;QADW,QAAG,GAAH,GAAG,CAAe;QAEpC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;IAC1B,CAAC;IAGD,OAAO,CAAC,GAAY;QAClB,OAAO,GAAG,CAAA;IACZ,CAAC;IAGD,MAAM,CAAC,GAAY,EAAE,GAAW;QAC9B,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,kBAAkB,CAAC,OAAe;QAChC,IAAI,CAAC,OAAO;YAAE,OAAM;QACpB,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACrD,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;YAC9B,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBAC3B,OAAO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AO;;sDAElB;AAcD;IADC,2BAAiB,CAAC,iBAAI,CAAC;;qCACd,oBAAO;;oDAShB;AAGD;IADC,2BAAiB,CAAC,wBAAW,CAAC;;qCACnB,oBAAO;;sDASlB;AAGD;IADC,2BAAiB,CAAC,MAAM,CAAC;;qCACd,oBAAO;;sDAGlB;AAcD;IADC,2BAAiB,CAAC,iBAAI,CAAC;;qCACd,oBAAO;;oDAKhB;AA5EH,4DA6EC"}
@@ -1,10 +0,0 @@
1
- import { BuiltInModule } from './BuiltInModule';
2
- import { Client, CommandInteraction, CommandInteractionOptionResolver } from 'discord.js';
3
- import { CommandClient } from '../structures';
4
- export declare class BuiltinSlashCommandConverters extends BuiltInModule {
5
- private cts;
6
- client: Client;
7
- constructor(cts: CommandClient);
8
- message(interaction: CommandInteraction): CommandInteraction<import("discord.js").CacheType>;
9
- optionResolver(interaction: CommandInteraction): CommandInteractionOptionResolver;
10
- }
@@ -1,42 +0,0 @@
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.BuiltinSlashCommandConverters = void 0;
13
- const BuiltInModule_1 = require("./BuiltInModule");
14
- const command_1 = require("../command");
15
- const discord_js_1 = require("discord.js");
16
- class BuiltinSlashCommandConverters extends BuiltInModule_1.BuiltInModule {
17
- constructor(cts) {
18
- super();
19
- this.cts = cts;
20
- this.client = cts.client;
21
- }
22
- message(interaction) {
23
- return interaction;
24
- }
25
- optionResolver(interaction) {
26
- return interaction.options;
27
- }
28
- }
29
- __decorate([
30
- command_1.slashArgumentConverter(discord_js_1.CommandInteraction),
31
- __metadata("design:type", Function),
32
- __metadata("design:paramtypes", [discord_js_1.CommandInteraction]),
33
- __metadata("design:returntype", void 0)
34
- ], BuiltinSlashCommandConverters.prototype, "message", null);
35
- __decorate([
36
- command_1.slashArgumentConverter(discord_js_1.CommandInteractionOptionResolver),
37
- __metadata("design:type", Function),
38
- __metadata("design:paramtypes", [discord_js_1.CommandInteraction]),
39
- __metadata("design:returntype", discord_js_1.CommandInteractionOptionResolver)
40
- ], BuiltinSlashCommandConverters.prototype, "optionResolver", null);
41
- exports.BuiltinSlashCommandConverters = BuiltinSlashCommandConverters;
42
- //# sourceMappingURL=BuiltinSlashCommandConverters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BuiltinSlashCommandConverters.js","sourceRoot":"","sources":["../../src/builtinModules/BuiltinSlashCommandConverters.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAA+C;AAC/C,wCAAmD;AACnD,2CAAyF;AAGzF,MAAa,6BAA8B,SAAQ,6BAAa;IAG9D,YAAoB,GAAkB;QACpC,KAAK,EAAE,CAAA;QADW,QAAG,GAAH,GAAG,CAAe;QAEpC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;IAC1B,CAAC;IAGD,OAAO,CAAC,WAA+B;QACrC,OAAO,WAAW,CAAA;IACpB,CAAC;IAGD,cAAc,CAAC,WAA+B;QAC5C,OAAO,WAAW,CAAC,OAA2C,CAAA;IAChE,CAAC;CACF;AARC;IADC,gCAAsB,CAAC,+BAAkB,CAAC;;qCACtB,+BAAkB;;4DAEtC;AAGD;IADC,gCAAsB,CAAC,6CAAgC,CAAC;;qCAC7B,+BAAkB;oCAAG,6CAAgC;mEAEhF;AAhBH,sEAiBC"}
@@ -1,14 +0,0 @@
1
- import { BuiltInModule } from './BuiltInModule';
2
- import { Registry } from '../structures';
3
- import { Interaction, Message } from 'discord.js';
4
- export declare class CommandHandler extends BuiltInModule {
5
- private registry;
6
- private readonly client;
7
- constructor(registry: Registry);
8
- message(msg: Message): Promise<boolean | undefined>;
9
- private command;
10
- private messageComponent;
11
- private userContextMenu;
12
- private messageContextMenu;
13
- interaction(i: Interaction): Promise<boolean | undefined>;
14
- }