@went.tf/discord-bot-framework 2.0.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 (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +550 -0
  3. package/build/.tsbuildinfo +1 -0
  4. package/build/api-client/api-client.d.ts +13 -0
  5. package/build/api-client/api-client.d.ts.map +1 -0
  6. package/build/api-client/api-client.js +147 -0
  7. package/build/api-client/api-client.js.map +1 -0
  8. package/build/api-client/api-http-exception.d.ts +7 -0
  9. package/build/api-client/api-http-exception.d.ts.map +1 -0
  10. package/build/api-client/api-http-exception.js +12 -0
  11. package/build/api-client/api-http-exception.js.map +1 -0
  12. package/build/api-client/index.d.ts +4 -0
  13. package/build/api-client/index.d.ts.map +1 -0
  14. package/build/api-client/index.js +4 -0
  15. package/build/api-client/index.js.map +1 -0
  16. package/build/api-client/types.d.ts +105 -0
  17. package/build/api-client/types.d.ts.map +1 -0
  18. package/build/api-client/types.js +8 -0
  19. package/build/api-client/types.js.map +1 -0
  20. package/build/client/create-bot-client.d.ts +14 -0
  21. package/build/client/create-bot-client.d.ts.map +1 -0
  22. package/build/client/create-bot-client.js +19 -0
  23. package/build/client/create-bot-client.js.map +1 -0
  24. package/build/client/create-shard-manager.d.ts +17 -0
  25. package/build/client/create-shard-manager.d.ts.map +1 -0
  26. package/build/client/create-shard-manager.js +26 -0
  27. package/build/client/create-shard-manager.js.map +1 -0
  28. package/build/client/index.d.ts +3 -0
  29. package/build/client/index.d.ts.map +1 -0
  30. package/build/client/index.js +3 -0
  31. package/build/client/index.js.map +1 -0
  32. package/build/commands/build-application-commands-body.d.ts +39 -0
  33. package/build/commands/build-application-commands-body.d.ts.map +1 -0
  34. package/build/commands/build-application-commands-body.js +127 -0
  35. package/build/commands/build-application-commands-body.js.map +1 -0
  36. package/build/commands/fixed-reply-command-factory.d.ts +10 -0
  37. package/build/commands/fixed-reply-command-factory.d.ts.map +1 -0
  38. package/build/commands/fixed-reply-command-factory.js +19 -0
  39. package/build/commands/fixed-reply-command-factory.js.map +1 -0
  40. package/build/commands/index.d.ts +4 -0
  41. package/build/commands/index.d.ts.map +1 -0
  42. package/build/commands/index.js +4 -0
  43. package/build/commands/index.js.map +1 -0
  44. package/build/commands/registration.d.ts +24 -0
  45. package/build/commands/registration.d.ts.map +1 -0
  46. package/build/commands/registration.js +69 -0
  47. package/build/commands/registration.js.map +1 -0
  48. package/build/commands/schema/application-command-leaf-option.schema.d.ts +230 -0
  49. package/build/commands/schema/application-command-leaf-option.schema.d.ts.map +1 -0
  50. package/build/commands/schema/application-command-leaf-option.schema.js +129 -0
  51. package/build/commands/schema/application-command-leaf-option.schema.js.map +1 -0
  52. package/build/commands/schema/application-command-leaf-option.schema.json +258 -0
  53. package/build/commands/schema/application-command-option-choice.schema.d.ts +18 -0
  54. package/build/commands/schema/application-command-option-choice.schema.d.ts.map +1 -0
  55. package/build/commands/schema/application-command-option-choice.schema.js +12 -0
  56. package/build/commands/schema/application-command-option-choice.schema.js.map +1 -0
  57. package/build/commands/schema/application-command-option-choice.schema.json +23 -0
  58. package/build/commands/schema/application-command-option.schema.d.ts +12 -0
  59. package/build/commands/schema/application-command-option.schema.d.ts.map +1 -0
  60. package/build/commands/schema/application-command-option.schema.js +13 -0
  61. package/build/commands/schema/application-command-option.schema.js.map +1 -0
  62. package/build/commands/schema/application-command-option.schema.json +14 -0
  63. package/build/commands/schema/application-command-subcommand-group.schema.d.ts +28 -0
  64. package/build/commands/schema/application-command-subcommand-group.schema.d.ts.map +1 -0
  65. package/build/commands/schema/application-command-subcommand-group.schema.js +22 -0
  66. package/build/commands/schema/application-command-subcommand-group.schema.js.map +1 -0
  67. package/build/commands/schema/application-command-subcommand-group.schema.json +26 -0
  68. package/build/commands/schema/application-command-subcommand.schema.d.ts +29 -0
  69. package/build/commands/schema/application-command-subcommand.schema.d.ts.map +1 -0
  70. package/build/commands/schema/application-command-subcommand.schema.js +23 -0
  71. package/build/commands/schema/application-command-subcommand.schema.js.map +1 -0
  72. package/build/commands/schema/application-command-subcommand.schema.json +26 -0
  73. package/build/commands/schema/application-command-type.schema.d.ts +6 -0
  74. package/build/commands/schema/application-command-type.schema.d.ts.map +1 -0
  75. package/build/commands/schema/application-command-type.schema.js +6 -0
  76. package/build/commands/schema/application-command-type.schema.js.map +1 -0
  77. package/build/commands/schema/application-command-type.schema.json +9 -0
  78. package/build/commands/schema/application-integration-type.schema.d.ts +6 -0
  79. package/build/commands/schema/application-integration-type.schema.d.ts.map +1 -0
  80. package/build/commands/schema/application-integration-type.schema.js +6 -0
  81. package/build/commands/schema/application-integration-type.schema.js.map +1 -0
  82. package/build/commands/schema/application-integration-type.schema.json +8 -0
  83. package/build/commands/schema/channel-type.schema.d.ts +6 -0
  84. package/build/commands/schema/channel-type.schema.d.ts.map +1 -0
  85. package/build/commands/schema/channel-type.schema.js +6 -0
  86. package/build/commands/schema/channel-type.schema.js.map +1 -0
  87. package/build/commands/schema/channel-type.schema.json +16 -0
  88. package/build/commands/schema/chat-input-command.schema.d.ts +45 -0
  89. package/build/commands/schema/chat-input-command.schema.d.ts.map +1 -0
  90. package/build/commands/schema/chat-input-command.schema.js +34 -0
  91. package/build/commands/schema/chat-input-command.schema.js.map +1 -0
  92. package/build/commands/schema/chat-input-command.schema.json +46 -0
  93. package/build/commands/schema/commands-file.schema.d.ts +18 -0
  94. package/build/commands/schema/commands-file.schema.d.ts.map +1 -0
  95. package/build/commands/schema/commands-file.schema.js +16 -0
  96. package/build/commands/schema/commands-file.schema.js.map +1 -0
  97. package/build/commands/schema/commands-file.schema.json +14 -0
  98. package/build/commands/schema/context-menu-command.schema.d.ts +40 -0
  99. package/build/commands/schema/context-menu-command.schema.d.ts.map +1 -0
  100. package/build/commands/schema/context-menu-command.schema.js +32 -0
  101. package/build/commands/schema/context-menu-command.schema.js.map +1 -0
  102. package/build/commands/schema/context-menu-command.schema.json +40 -0
  103. package/build/commands/schema/context-menu-name.schema.d.ts +7 -0
  104. package/build/commands/schema/context-menu-name.schema.d.ts.map +1 -0
  105. package/build/commands/schema/context-menu-name.schema.js +7 -0
  106. package/build/commands/schema/context-menu-name.schema.js.map +1 -0
  107. package/build/commands/schema/context-menu-name.schema.json +6 -0
  108. package/build/commands/schema/default-member-permissions.schema.d.ts +7 -0
  109. package/build/commands/schema/default-member-permissions.schema.d.ts.map +1 -0
  110. package/build/commands/schema/default-member-permissions.schema.js +7 -0
  111. package/build/commands/schema/default-member-permissions.schema.js.map +1 -0
  112. package/build/commands/schema/default-member-permissions.schema.json +6 -0
  113. package/build/commands/schema/index.d.ts +77 -0
  114. package/build/commands/schema/index.d.ts.map +1 -0
  115. package/build/commands/schema/index.js +48 -0
  116. package/build/commands/schema/index.js.map +1 -0
  117. package/build/commands/schema/interaction-context-type.schema.d.ts +6 -0
  118. package/build/commands/schema/interaction-context-type.schema.d.ts.map +1 -0
  119. package/build/commands/schema/interaction-context-type.schema.js +6 -0
  120. package/build/commands/schema/interaction-context-type.schema.js.map +1 -0
  121. package/build/commands/schema/interaction-context-type.schema.json +9 -0
  122. package/build/commands/schema/option-name.schema.d.ts +7 -0
  123. package/build/commands/schema/option-name.schema.d.ts.map +1 -0
  124. package/build/commands/schema/option-name.schema.js +7 -0
  125. package/build/commands/schema/option-name.schema.js.map +1 -0
  126. package/build/commands/schema/option-name.schema.json +6 -0
  127. package/build/commands/schema/parse-commands-file.d.ts +19 -0
  128. package/build/commands/schema/parse-commands-file.d.ts.map +1 -0
  129. package/build/commands/schema/parse-commands-file.js +19 -0
  130. package/build/commands/schema/parse-commands-file.js.map +1 -0
  131. package/build/db/create-postgres-prisma-db.d.ts +20 -0
  132. package/build/db/create-postgres-prisma-db.d.ts.map +1 -0
  133. package/build/db/create-postgres-prisma-db.js +17 -0
  134. package/build/db/create-postgres-prisma-db.js.map +1 -0
  135. package/build/db/index.d.ts +2 -0
  136. package/build/db/index.d.ts.map +1 -0
  137. package/build/db/index.js +2 -0
  138. package/build/db/index.js.map +1 -0
  139. package/build/dev/create-handler-watcher.d.ts +23 -0
  140. package/build/dev/create-handler-watcher.d.ts.map +1 -0
  141. package/build/dev/create-handler-watcher.js +55 -0
  142. package/build/dev/create-handler-watcher.js.map +1 -0
  143. package/build/dev/create-source-reloader.d.ts +37 -0
  144. package/build/dev/create-source-reloader.d.ts.map +1 -0
  145. package/build/dev/create-source-reloader.js +42 -0
  146. package/build/dev/create-source-reloader.js.map +1 -0
  147. package/build/dev/index.d.ts +3 -0
  148. package/build/dev/index.d.ts.map +1 -0
  149. package/build/dev/index.js +3 -0
  150. package/build/dev/index.js.map +1 -0
  151. package/build/dev/reload-loader.d.ts +11 -0
  152. package/build/dev/reload-loader.d.ts.map +1 -0
  153. package/build/dev/reload-loader.js +28 -0
  154. package/build/dev/reload-loader.js.map +1 -0
  155. package/build/env/define-env.d.ts +25 -0
  156. package/build/env/define-env.d.ts.map +1 -0
  157. package/build/env/define-env.js +24 -0
  158. package/build/env/define-env.js.map +1 -0
  159. package/build/env/helpers.d.ts +9 -0
  160. package/build/env/helpers.d.ts.map +1 -0
  161. package/build/env/helpers.js +9 -0
  162. package/build/env/helpers.js.map +1 -0
  163. package/build/env/index.d.ts +3 -0
  164. package/build/env/index.d.ts.map +1 -0
  165. package/build/env/index.js +3 -0
  166. package/build/env/index.js.map +1 -0
  167. package/build/i18n/create-command-localizer.d.ts +27 -0
  168. package/build/i18n/create-command-localizer.d.ts.map +1 -0
  169. package/build/i18n/create-command-localizer.js +40 -0
  170. package/build/i18n/create-command-localizer.js.map +1 -0
  171. package/build/i18n/create-i18n-initializer.d.ts +18 -0
  172. package/build/i18n/create-i18n-initializer.d.ts.map +1 -0
  173. package/build/i18n/create-i18n-initializer.js +34 -0
  174. package/build/i18n/create-i18n-initializer.js.map +1 -0
  175. package/build/i18n/index.d.ts +3 -0
  176. package/build/i18n/index.d.ts.map +1 -0
  177. package/build/i18n/index.js +3 -0
  178. package/build/i18n/index.js.map +1 -0
  179. package/build/index.d.ts +8 -0
  180. package/build/index.d.ts.map +1 -0
  181. package/build/index.js +12 -0
  182. package/build/index.js.map +1 -0
  183. package/build/interactions/custom-id.d.ts +9 -0
  184. package/build/interactions/custom-id.d.ts.map +1 -0
  185. package/build/interactions/custom-id.js +15 -0
  186. package/build/interactions/custom-id.js.map +1 -0
  187. package/build/interactions/dispatch.d.ts +35 -0
  188. package/build/interactions/dispatch.d.ts.map +1 -0
  189. package/build/interactions/dispatch.js +87 -0
  190. package/build/interactions/dispatch.js.map +1 -0
  191. package/build/interactions/handle-interaction-error.d.ts +22 -0
  192. package/build/interactions/handle-interaction-error.d.ts.map +1 -0
  193. package/build/interactions/handle-interaction-error.js +65 -0
  194. package/build/interactions/handle-interaction-error.js.map +1 -0
  195. package/build/interactions/index.d.ts +7 -0
  196. package/build/interactions/index.d.ts.map +1 -0
  197. package/build/interactions/index.js +7 -0
  198. package/build/interactions/index.js.map +1 -0
  199. package/build/interactions/registry.d.ts +32 -0
  200. package/build/interactions/registry.d.ts.map +1 -0
  201. package/build/interactions/registry.js +49 -0
  202. package/build/interactions/registry.js.map +1 -0
  203. package/build/interactions/router.d.ts +28 -0
  204. package/build/interactions/router.d.ts.map +1 -0
  205. package/build/interactions/router.js +48 -0
  206. package/build/interactions/router.js.map +1 -0
  207. package/build/interactions/types.d.ts +37 -0
  208. package/build/interactions/types.d.ts.map +1 -0
  209. package/build/interactions/types.js +2 -0
  210. package/build/interactions/types.js.map +1 -0
  211. package/build/logger/create-logger.d.ts +27 -0
  212. package/build/logger/create-logger.d.ts.map +1 -0
  213. package/build/logger/create-logger.js +36 -0
  214. package/build/logger/create-logger.js.map +1 -0
  215. package/build/logger/dev-null-logger.d.ts +11 -0
  216. package/build/logger/dev-null-logger.d.ts.map +1 -0
  217. package/build/logger/dev-null-logger.js +19 -0
  218. package/build/logger/dev-null-logger.js.map +1 -0
  219. package/build/logger/discord-webhook-batcher.d.ts +38 -0
  220. package/build/logger/discord-webhook-batcher.d.ts.map +1 -0
  221. package/build/logger/discord-webhook-batcher.js +87 -0
  222. package/build/logger/discord-webhook-batcher.js.map +1 -0
  223. package/build/logger/discord-webhook-transport.d.ts +9 -0
  224. package/build/logger/discord-webhook-transport.d.ts.map +1 -0
  225. package/build/logger/discord-webhook-transport.js +20 -0
  226. package/build/logger/discord-webhook-transport.js.map +1 -0
  227. package/build/logger/index.d.ts +5 -0
  228. package/build/logger/index.d.ts.map +1 -0
  229. package/build/logger/index.js +5 -0
  230. package/build/logger/index.js.map +1 -0
  231. package/build/logger/logger.d.ts +30 -0
  232. package/build/logger/logger.d.ts.map +1 -0
  233. package/build/logger/logger.js +84 -0
  234. package/build/logger/logger.js.map +1 -0
  235. package/build/logger/pino-pretty-options.d.ts +12 -0
  236. package/build/logger/pino-pretty-options.d.ts.map +1 -0
  237. package/build/logger/pino-pretty-options.js +17 -0
  238. package/build/logger/pino-pretty-options.js.map +1 -0
  239. package/build/logger/types.d.ts +6 -0
  240. package/build/logger/types.d.ts.map +1 -0
  241. package/build/logger/types.js +2 -0
  242. package/build/logger/types.js.map +1 -0
  243. package/build/utils/discord-lookups.d.ts +16 -0
  244. package/build/utils/discord-lookups.d.ts.map +1 -0
  245. package/build/utils/discord-lookups.js +39 -0
  246. package/build/utils/discord-lookups.js.map +1 -0
  247. package/build/utils/get-git-data.d.ts +8 -0
  248. package/build/utils/get-git-data.d.ts.map +1 -0
  249. package/build/utils/get-git-data.js +18 -0
  250. package/build/utils/get-git-data.js.map +1 -0
  251. package/build/utils/index.d.ts +7 -0
  252. package/build/utils/index.d.ts.map +1 -0
  253. package/build/utils/index.js +7 -0
  254. package/build/utils/index.js.map +1 -0
  255. package/build/utils/messaging.d.ts +15 -0
  256. package/build/utils/messaging.d.ts.map +1 -0
  257. package/build/utils/messaging.js +71 -0
  258. package/build/utils/messaging.js.map +1 -0
  259. package/build/utils/promises.d.ts +6 -0
  260. package/build/utils/promises.d.ts.map +1 -0
  261. package/build/utils/promises.js +13 -0
  262. package/build/utils/promises.js.map +1 -0
  263. package/build/utils/run-attempts.d.ts +6 -0
  264. package/build/utils/run-attempts.d.ts.map +1 -0
  265. package/build/utils/run-attempts.js +16 -0
  266. package/build/utils/run-attempts.js.map +1 -0
  267. package/build/utils/strings.d.ts +7 -0
  268. package/build/utils/strings.d.ts.map +1 -0
  269. package/build/utils/strings.js +39 -0
  270. package/build/utils/strings.js.map +1 -0
  271. package/package.json +146 -0
@@ -0,0 +1,5 @@
1
+ export * from './types.js';
2
+ export * from './logger.js';
3
+ export * from './dev-null-logger.js';
4
+ export * from './create-logger.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './types.js';
2
+ export * from './logger.js';
3
+ export * from './dev-null-logger.js';
4
+ export * from './create-logger.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import pino from 'pino';
2
+ import { LogMethod, NestableLogger } from './types.js';
3
+ export declare class Logger implements NestableLogger {
4
+ protected prefixes: string[];
5
+ protected mutedMethods: Set<LogMethod>;
6
+ protected pino: pino.Logger;
7
+ constructor(prefix?: string | string[], mutedMethods?: LogMethod[] | Set<LogMethod>);
8
+ /**
9
+ * Builds a Logger from an existing pino instance via `.child()`, reusing whatever
10
+ * transport (or lack thereof) the parent already has, rather than constructing a
11
+ * new pino root. Used internally by `nest()`, `muteMethods()`, and `createLogger()`
12
+ * so nested loggers never spawn additional `pino.transport()` worker threads.
13
+ */
14
+ static withPino(parentPino: pino.Logger, prefixes: string[], mutedMethods: Set<LogMethod>): Logger;
15
+ static fromShardInfo(shards?: string | string[]): Logger;
16
+ debug(...params: unknown[]): void;
17
+ info(...params: unknown[]): void;
18
+ log(...params: unknown[]): void;
19
+ warn(...params: unknown[]): void;
20
+ error(...params: unknown[]): void;
21
+ /**
22
+ * Returns a new logger with the provided prefix(es) added to the existing prefix list
23
+ */
24
+ nest(nestedPrefix: string | string[]): Logger;
25
+ /**
26
+ * Returns a new logger with only the provided methods muted
27
+ */
28
+ muteMethods(mutedMethods: LogMethod[]): Logger;
29
+ }
30
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAevD,qBAAa,MAAO,YAAW,cAAc;IAC3C,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAE7B,SAAS,CAAC,YAAY,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAEvC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;gBAEhB,MAAM,GAAE,MAAM,GAAG,MAAM,EAAO,EAAE,YAAY,GAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAM;IAS3F;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,MAAM;IAQlG,MAAM,CAAC,aAAa,CAAC,MAAM,GAAE,MAAM,GAAG,MAAM,EAAO,GAAG,MAAM;IAK5D,KAAK,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI;IAKjC,IAAI,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI;IAOhC,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI;IAK/B,IAAI,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI;IAKhC,KAAK,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI;IAKjC;;OAEG;IACH,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAK7C;;OAEG;IACH,WAAW,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,MAAM;CAG/C"}
@@ -0,0 +1,84 @@
1
+ import { format } from 'node:util';
2
+ import pino from 'pino';
3
+ import pretty from 'pino-pretty';
4
+ import { PINO_PRETTY_OPTIONS } from './pino-pretty-options.js';
5
+ function toArray(value) {
6
+ return Array.isArray(value) ? value : [value];
7
+ }
8
+ function toSet(value) {
9
+ return Array.isArray(value) ? new Set(value) : value;
10
+ }
11
+ function formatPrefixLabel(prefixes) {
12
+ return prefixes.length === 0 ? '' : `[${prefixes.join('][')}] `;
13
+ }
14
+ export class Logger {
15
+ prefixes;
16
+ mutedMethods;
17
+ pino;
18
+ constructor(prefix = [], mutedMethods = []) {
19
+ this.prefixes = toArray(prefix);
20
+ this.mutedMethods = toSet(mutedMethods);
21
+ // Bare constructor stays worker-thread-free: pino-pretty's stream is built
22
+ // synchronously in-process here, unlike createLogger()'s pino.transport() path.
23
+ const root = pino({ level: 'trace' }, pretty(PINO_PRETTY_OPTIONS));
24
+ this.pino = root.child({ prefixLabel: formatPrefixLabel(this.prefixes) });
25
+ }
26
+ /**
27
+ * Builds a Logger from an existing pino instance via `.child()`, reusing whatever
28
+ * transport (or lack thereof) the parent already has, rather than constructing a
29
+ * new pino root. Used internally by `nest()`, `muteMethods()`, and `createLogger()`
30
+ * so nested loggers never spawn additional `pino.transport()` worker threads.
31
+ */
32
+ static withPino(parentPino, prefixes, mutedMethods) {
33
+ const instance = Object.create(Logger.prototype);
34
+ instance.prefixes = prefixes;
35
+ instance.mutedMethods = mutedMethods;
36
+ instance.pino = parentPino.child({ prefixLabel: formatPrefixLabel(prefixes) });
37
+ return instance;
38
+ }
39
+ static fromShardInfo(shards = '') {
40
+ const shardsSuffix = Array.isArray(shards) ? shards.join(',') : shards;
41
+ return new Logger(`Shard#${shardsSuffix}`);
42
+ }
43
+ debug(...params) {
44
+ if (this.mutedMethods.has('debug'))
45
+ return;
46
+ this.pino.debug(format(...params));
47
+ }
48
+ info(...params) {
49
+ if (this.mutedMethods.has('info'))
50
+ return;
51
+ this.pino.info(format(...params));
52
+ }
53
+ // pino has no 'log' level; map it onto 'info', matching the console-visible
54
+ // severity `log` and `info` shared before this migration.
55
+ log(...params) {
56
+ if (this.mutedMethods.has('log'))
57
+ return;
58
+ this.pino.info(format(...params));
59
+ }
60
+ warn(...params) {
61
+ if (this.mutedMethods.has('warn'))
62
+ return;
63
+ this.pino.warn(format(...params));
64
+ }
65
+ error(...params) {
66
+ if (this.mutedMethods.has('error'))
67
+ return;
68
+ this.pino.error(format(...params));
69
+ }
70
+ /**
71
+ * Returns a new logger with the provided prefix(es) added to the existing prefix list
72
+ */
73
+ nest(nestedPrefix) {
74
+ const nestedPrefixArray = [...this.prefixes, ...toArray(nestedPrefix)];
75
+ return Logger.withPino(this.pino, nestedPrefixArray, this.mutedMethods);
76
+ }
77
+ /**
78
+ * Returns a new logger with only the provided methods muted
79
+ */
80
+ muteMethods(mutedMethods) {
81
+ return Logger.withPino(this.pino, this.prefixes, new Set(mutedMethods));
82
+ }
83
+ }
84
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,mBAAm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AE,OAAO;QAC1C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,GAAG,MAAiB;QACxB,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,OAAO;QAC3C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,YAA+B;QAClC,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;QACvE,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,YAAyB;QACnC,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import pretty from 'pino-pretty';
2
+ type PrettyOptions = NonNullable<Parameters<typeof pretty>[0]>;
3
+ /**
4
+ * Shared between the bare `Logger` constructor's synchronous pretty stream and
5
+ * `createLogger`'s console transport target, so both render the same
6
+ * `[prefix1][prefix2] message` bracket style pino's own bindings-based prefixLabel
7
+ * produces. `messageFormat` must stay a plain string template (not a function) so it
8
+ * survives being passed into a `pino.transport()` worker thread.
9
+ */
10
+ export declare const PINO_PRETTY_OPTIONS: PrettyOptions;
11
+ export {};
12
+ //# sourceMappingURL=pino-pretty-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pino-pretty-options.d.ts","sourceRoot":"","sources":["../../src/logger/pino-pretty-options.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,KAAK,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/D;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAQjC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shared between the bare `Logger` constructor's synchronous pretty stream and
3
+ * `createLogger`'s console transport target, so both render the same
4
+ * `[prefix1][prefix2] message` bracket style pino's own bindings-based prefixLabel
5
+ * produces. `messageFormat` must stay a plain string template (not a function) so it
6
+ * survives being passed into a `pino.transport()` worker thread.
7
+ */
8
+ export const PINO_PRETTY_OPTIONS = {
9
+ colorize: true,
10
+ ignore: 'pid,hostname,prefixLabel',
11
+ messageFormat: '{prefixLabel}{msg}',
12
+ // Writes synchronously (fs.writeSync) instead of sonic-boom's default async
13
+ // buffering, so log output can't be lost on abrupt process exit and so it's
14
+ // deterministically observable/testable via a single fs.writeSync call.
15
+ sync: true,
16
+ };
17
+ //# sourceMappingURL=pino-pretty-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pino-pretty-options.js","sourceRoot":"","sources":["../../src/logger/pino-pretty-options.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAkB;IAChD,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,0BAA0B;IAClC,aAAa,EAAE,oBAAoB;IACnC,4EAA4E;IAC5E,4EAA4E;IAC5E,wEAAwE;IACxE,IAAI,EAAE,IAAI;CACX,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type LogMethod = 'debug' | 'info' | 'log' | 'warn' | 'error';
2
+ export type NestableLogger = Record<LogMethod, (...params: unknown[]) => void> & {
3
+ nest(nestedPrefix: string | string[]): NestableLogger;
4
+ muteMethods(mutedMethods: LogMethod[]): NestableLogger;
5
+ };
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/logger/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,CAAC;AAEZ,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC,GAAG;IAC/E,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC;IAEtD,WAAW,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,cAAc,CAAC;CACxD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/logger/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { Client, Guild, GuildMember, Interaction, Role, TextBasedChannel, TextChannel } from 'discord.js';
2
+ export declare const getServer: (client: Client, serverId: string) => Guild;
3
+ export declare const findServerTextChannelByName: <Name extends string>(server: Guild, name: Name) => TextChannel & {
4
+ name: Name;
5
+ };
6
+ export declare const findServerRoleByName: <Name extends string>(server: Guild, name: Name) => Role & {
7
+ name: Name;
8
+ };
9
+ export declare const isChannelName: (channel: TextBasedChannel | null | undefined, name: string) => boolean;
10
+ export declare const findServerMember: (interaction: Interaction) => GuildMember;
11
+ export declare const getServerMemberRole: (member: GuildMember, roleName: string) => Role | undefined;
12
+ export declare const serverMemberHasRole: (member: GuildMember, role: Role) => boolean;
13
+ export declare const isSameObject: <T extends {
14
+ id: string;
15
+ }>(member1: Pick<T, "id">, member2: Pick<T, "id">) => boolean;
16
+ //# sourceMappingURL=discord-lookups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discord-lookups.d.ts","sourceRoot":"","sources":["../../src/utils/discord-lookups.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,KAAK,EACL,WAAW,EACX,WAAW,EACX,IAAI,EACJ,gBAAgB,EAChB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,EAAE,UAAU,MAAM,KAAG,KAM5D,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,IAAI,SAAS,MAAM,EAAE,QAAQ,KAAK,EAAE,MAAM,IAAI,KAAG,WAAW,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAStH,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,IAAI,SAAS,MAAM,EAAE,QAAQ,KAAK,EAAE,MAAM,IAAI,KAAG,IAAI,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAMxG,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,gBAAgB,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,MAAM,KAAG,OAAyE,CAAC;AAErK,eAAO,MAAM,gBAAgB,GAAI,aAAa,WAAW,KAAG,WAY3D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,WAAW,EAAE,UAAU,MAAM,KAAG,IAAI,GAAG,SAElF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,WAAW,EAAE,MAAM,IAAI,KAAG,OAErE,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,KAAG,OAEvG,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { ChannelType, GuildMember, } from 'discord.js';
2
+ export const getServer = (client, serverId) => {
3
+ const foundServer = client.guilds.cache.get(serverId);
4
+ if (!foundServer)
5
+ throw new Error(`Could not find server with ID ${serverId}`);
6
+ return foundServer;
7
+ };
8
+ export const findServerTextChannelByName = (server, name) => {
9
+ const foundChannel = server?.channels.cache
10
+ .find((channel) => channel.name === name);
11
+ if (!foundChannel)
12
+ throw new Error(`Could not find a channel named ${name}`);
13
+ if (foundChannel.isThread())
14
+ throw new Error(`Found thread for name ${name}, expected GuildChannel`);
15
+ if (foundChannel.type !== ChannelType.GuildText)
16
+ throw new Error(`Found non-text channel for name ${name} (type=${foundChannel.type})`);
17
+ return foundChannel;
18
+ };
19
+ export const findServerRoleByName = (server, name) => {
20
+ const foundRole = server?.roles.cache.find((role) => role.name === name);
21
+ if (!foundRole)
22
+ throw new Error(`Could not find a role named ${name}`);
23
+ return foundRole;
24
+ };
25
+ export const isChannelName = (channel, name) => Boolean(channel && 'name' in channel && channel.name === name);
26
+ export const findServerMember = (interaction) => {
27
+ const serverMember = interaction.member;
28
+ if (!serverMember) {
29
+ throw new Error('Could not find `member` on interaction');
30
+ }
31
+ if (!(serverMember instanceof GuildMember)) {
32
+ throw new Error('Expected `serverMember` to be an instance of GuildMember');
33
+ }
34
+ return serverMember;
35
+ };
36
+ export const getServerMemberRole = (member, roleName) => (member.roles.cache.find((role) => role.name === roleName));
37
+ export const serverMemberHasRole = (member, role) => (member.roles.cache.has(role.id));
38
+ export const isSameObject = (member1, member2) => (member1.id === member2.id);
39
+ //# sourceMappingURL=discord-lookups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discord-lookups.js","sourceRoot":"","sources":["../../src/utils/discord-lookups.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGX,WAAW,GAKZ,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAS,EAAE;IACnE,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAEtD,IAAI,CAAC,WAAW;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,QAAQ,EAAE,CAAC,CAAC;IAE/E,OA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M,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC;IAExC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,CAAC,CAAC,YAAY,YAAY,WAAW,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAmB,EAAE,QAAgB,EAAoB,EAAE,CAAC,CAC9F,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAC1D,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAmB,EAAE,IAAU,EAAW,EAAE,CAAC,CAC/E,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAA2B,OAAsB,EAAE,OAAsB,EAAW,EAAE,CAAC,CACjH,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,EAAE,CAC1B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { NestableLogger } from '../logger/types.js';
2
+ export declare function getGitData({ logger }: {
3
+ logger: NestableLogger;
4
+ }): Promise<{
5
+ hash: string;
6
+ timeAgo: string;
7
+ }>;
8
+ //# sourceMappingURL=get-git-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-git-data.d.ts","sourceRoot":"","sources":["../../src/utils/get-git-data.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAe7G"}
@@ -0,0 +1,18 @@
1
+ import { exec } from 'node:child_process';
2
+ import shellEscape from 'shell-escape';
3
+ export function getGitData({ logger }) {
4
+ return new Promise((res, rej) => {
5
+ const separator = ';';
6
+ const command = shellEscape(`env -i git log -1 --date=short --pretty=format:%h${separator}%ct`.split(' '));
7
+ exec(command, { cwd: process.cwd() }, (err, data) => {
8
+ if (err) {
9
+ logger.error('Error getting commit data', err);
10
+ rej(new Error('Error while getting commit data'));
11
+ return;
12
+ }
13
+ const [hash, timeAgo] = data.trim().split(separator);
14
+ res({ hash, timeAgo });
15
+ });
16
+ });
17
+ }
18
+ //# sourceMappingURL=get-git-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-git-data.js","sourceRoot":"","sources":["../../src/utils/get-git-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,WAAW,MAAM,cAAc,CAAC;AAGvC,MAAM,UAAU,UAAU,CAAC,EAAE,MAAM,EAA8B;IAC/D,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC9B,MAAM,SAAS,GAAG,GAAG,CAAC;QACtB,MAAM,OAAO,GAAG,WAAW,CAAC,oDAAoD,SAAS,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3G,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YAClD,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,CAAC,KAAK,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;gBAC/C,GAAG,CAAC,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC,CAAC;gBAClD,OAAO;YACT,CAAC;YAED,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACrD,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './run-attempts.js';
2
+ export * from './get-git-data.js';
3
+ export * from './promises.js';
4
+ export * from './strings.js';
5
+ export * from './messaging.js';
6
+ export * from './discord-lookups.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './run-attempts.js';
2
+ export * from './get-git-data.js';
3
+ export * from './promises.js';
4
+ export * from './strings.js';
5
+ export * from './messaging.js';
6
+ export * from './discord-lookups.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Snowflake } from 'discord-api-types/v10';
2
+ import { BaseGuildTextChannel, Collection, CommandInteraction, CommandInteractionOption, Message, User } from 'discord.js';
3
+ export declare function sendMessageSlices(channel: BaseGuildTextChannel, message: string): Promise<void>;
4
+ export declare function loadAllMessages(channel: BaseGuildTextChannel): Promise<Collection<Snowflake, Message>>;
5
+ type UserFriendCode = `@${string}` | `${string}#${string}`;
6
+ /**
7
+ * Formats a user as `@username` (the post-migration username system) or
8
+ * `username#discriminator` (legacy accounts, `discriminator !== '0'`).
9
+ */
10
+ export declare const getUserFriendCode: (user: User) => UserFriendCode;
11
+ export declare const getUserIdentifier: (user: User) => `${UserFriendCode} (${string})`;
12
+ export declare const stringifyChannelName: (channel: CommandInteraction["channel"]) => string;
13
+ export declare const stringifyOptionsData: (data: readonly CommandInteractionOption[]) => string;
14
+ export {};
15
+ //# sourceMappingURL=messaging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/utils/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAEL,oBAAoB,EAEpB,UAAU,EACV,kBAAkB,EAClB,wBAAwB,EACxB,OAAO,EACP,IAAI,EACL,MAAM,YAAY,CAAC;AAIpB,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIrG;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAmB5G;AAED,KAAK,cAAc,GAAG,IAAI,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,KAAG,cAC8C,CAAC;AAE9F,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,KAAG,GAAG,cAAc,KAAK,MAAM,GAAgD,CAAC;AAE5H,eAAO,MAAM,oBAAoB,GAAI,SAAS,kBAAkB,CAAC,SAAS,CAAC,KAAG,MAa7E,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,SAAS,wBAAwB,EAAE,KAAG,MAqBrE,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { ApplicationCommandOptionType, ChannelType, Collection, } from 'discord.js';
2
+ import { queueLazyPromises } from './promises.js';
3
+ import { condenseStringArray } from './strings.js';
4
+ export async function sendMessageSlices(channel, message) {
5
+ const messageSlices = condenseStringArray(message.split(/\n\n/g), 2000, '\n\n');
6
+ await queueLazyPromises(messageSlices.map((slice) => () => channel.send(slice)));
7
+ }
8
+ export async function loadAllMessages(channel) {
9
+ let beforeId;
10
+ let done = false;
11
+ let allMessages = new Collection();
12
+ while (!done) {
13
+ const messages = await channel.messages.fetch({
14
+ limit: 10,
15
+ before: beforeId || undefined,
16
+ });
17
+ if (messages.size > 0) {
18
+ beforeId = messages.lastKey();
19
+ allMessages = allMessages.concat(messages);
20
+ }
21
+ else {
22
+ done = true;
23
+ }
24
+ }
25
+ return allMessages;
26
+ }
27
+ /**
28
+ * Formats a user as `@username` (the post-migration username system) or
29
+ * `username#discriminator` (legacy accounts, `discriminator !== '0'`).
30
+ */
31
+ export const getUserFriendCode = (user) => user.discriminator === '0' ? `@${user.username}` : `${user.username}#${user.discriminator}`;
32
+ export const getUserIdentifier = (user) => `${getUserFriendCode(user)} (${user.id})`;
33
+ export const stringifyChannelName = (channel) => {
34
+ if (channel) {
35
+ let stringName;
36
+ if (channel.type === ChannelType.GuildText && 'name' in channel) {
37
+ stringName = `#${channel.name}`;
38
+ }
39
+ else {
40
+ stringName = channel.toString();
41
+ }
42
+ return `${stringName} (${channel.id})`;
43
+ }
44
+ return '(unknown channel)';
45
+ };
46
+ export const stringifyOptionsData = (data) => data.map((option) => {
47
+ const optionName = option.name;
48
+ let optionValue = option.value;
49
+ switch (option.type) {
50
+ case ApplicationCommandOptionType.Channel:
51
+ if (option.channel)
52
+ optionValue = `${option.channel.type === ChannelType.GuildText ? '#' : ''}${option.channel.name}`;
53
+ break;
54
+ case ApplicationCommandOptionType.User:
55
+ if (option.user)
56
+ optionValue = getUserIdentifier(option.user);
57
+ break;
58
+ case ApplicationCommandOptionType.Role:
59
+ if (option.role)
60
+ optionValue = `@${option.role.name}`;
61
+ break;
62
+ case ApplicationCommandOptionType.Subcommand:
63
+ optionValue = option.options ? stringifyOptionsData(option.options) : null;
64
+ break;
65
+ default:
66
+ break;
67
+ }
68
+ return `(${optionName}${optionValue !== null ? `:${optionValue}` : ''})`;
69
+ })
70
+ .join(' ');
71
+ //# sourceMappingURL=messaging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/utils/messaging.ts"],"names":[],"mappings":"AACA,OAAO,EACL,4BAA4B,EAE5B,WAAW,EACX,UAAU,GAKX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAA6B,EAAE,OAAe;IACpF,MAAM,aAAa,GAAG,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAEhF,MAAM,iBAAiB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAA6B;IACjE,IAAI,QAA4B,CAAC;IACjC,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,WAAW,GAAmC,IAAI,UAAU,EAAE,CAAC;IACnE,OAAO,CAAC,IAAI,EAAE,CAAC;QACb,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC5C,KAAK,EAAE,EAAE;YACT,MAAM,EAA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AC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAU,EAAE;IACrH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;IAC/B,IAAI,WAAW,GAAiD,MAAM,CAAC,KAAK,CAAC;IAC7E,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,4BAA4B,CAAC,OAAO;YACvC,IAAI,MAAM,CAAC,OAAO;gBAAE,WAAW,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACtH,MAAM;QACR,KAAK,4BAA4B,CAAC,IAAI;YACpC,IAAI,MAAM,CAAC,IAAI;gBAAE,WAAW,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC9D,MAAM;QACR,KAAK,4BAA4B,CAAC,IAAI;YACpC,IAAI,MAAM,CAAC,IAAI;gBAAE,WAAW,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACtD,MAAM;QACR,KAAK,4BAA4B,CAAC,UAAU;YAC1C,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC3E,MAAM;QACR;YACE,MAAM;IACV,CAAC;IACD,OAAO,IAAI,UAAU,GAAG,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC3E,CAAC,CAAC;KACC,IAAI,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type LazyPromise<T> = () => Promise<T>;
2
+ /**
3
+ * Takes a set of lazily-created promises and executes them in order.
4
+ */
5
+ export declare const queueLazyPromises: <T>(lazyPromises: LazyPromise<T>[]) => Promise<T[]>;
6
+ //# sourceMappingURL=promises.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promises.d.ts","sourceRoot":"","sources":["../../src/utils/promises.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,cAAc,WAAW,CAAC,CAAC,CAAC,EAAE,KAAG,OAAO,CAAC,CAAC,EAAE,CAQhF,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Takes a set of lazily-created promises and executes them in order.
3
+ */
4
+ export const queueLazyPromises = (lazyPromises) => {
5
+ let queue = Promise.resolve([]);
6
+ if (lazyPromises.length > 0) {
7
+ lazyPromises.forEach((lazyPromise) => {
8
+ queue = queue.then(async (list) => [...list, await lazyPromise()]);
9
+ });
10
+ }
11
+ return queue;
12
+ };
13
+ //# sourceMappingURL=promises.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promises.js","sourceRoot":"","sources":["../../src/utils/promises.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAI,YAA8B,EAAgB,EAAE;IACnF,IAAI,KAAK,GAAiB,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC9C,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YACnC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,WAAW,EAAE,CAAQ,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Runs the given attempts in sequence until one resolves to `true`.
3
+ * Returns whether any attempt succeeded.
4
+ */
5
+ export declare function runAttempts(attempts: (() => Promise<boolean>)[]): Promise<boolean>;
6
+ //# sourceMappingURL=run-attempts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-attempts.d.ts","sourceRoot":"","sources":["../../src/utils/run-attempts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAUxF"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Runs the given attempts in sequence until one resolves to `true`.
3
+ * Returns whether any attempt succeeded.
4
+ */
5
+ export async function runAttempts(attempts) {
6
+ const results = [];
7
+ for (const attempt of attempts) {
8
+ const result = await attempt();
9
+ results.push(result);
10
+ if (result) {
11
+ break;
12
+ }
13
+ }
14
+ return results.some((result) => result);
15
+ }
16
+ //# sourceMappingURL=run-attempts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-attempts.js","sourceRoot":"","sources":["../../src/utils/run-attempts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAoC;IACpE,MAAM,OAAO,GAAc,EAAE,CAAC;IAC9B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,OAAO,EAAE,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,IAAI,MAAM,EAAE,CAAC;YACX,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Takes an array of strings and tries to concatenate adjacent values together
3
+ * using `glue` until each individual item is no longer than `maxLength`, then
4
+ * returns the result.
5
+ */
6
+ export declare const condenseStringArray: (strings: string[], maxLength?: number, glue?: string) => string[];
7
+ //# sourceMappingURL=strings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/utils/strings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,EAAE,EAAE,kBAAgB,EAAE,aAAS,KAAG,MAAM,EAmC1F,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Takes an array of strings and tries to concatenate adjacent values together
3
+ * using `glue` until each individual item is no longer than `maxLength`, then
4
+ * returns the result.
5
+ */
6
+ export const condenseStringArray = (strings, maxLength = 2000, glue = '') => {
7
+ const condensedArray = [];
8
+ if (strings.length < 2)
9
+ return strings;
10
+ let currentItem = '';
11
+ const pushCurrentItem = (reset = true) => {
12
+ if (!currentItem)
13
+ return;
14
+ condensedArray.push(currentItem);
15
+ if (reset)
16
+ currentItem = '';
17
+ };
18
+ strings.forEach((item) => {
19
+ if (item.length >= maxLength) {
20
+ pushCurrentItem();
21
+ condensedArray.push(item);
22
+ return;
23
+ }
24
+ if (!currentItem) {
25
+ currentItem = item;
26
+ return;
27
+ }
28
+ const combinedItem = currentItem + glue + item;
29
+ if (combinedItem.length <= maxLength) {
30
+ currentItem = combinedItem;
31
+ return;
32
+ }
33
+ pushCurrentItem(false);
34
+ currentItem = item;
35
+ });
36
+ pushCurrentItem(false);
37
+ return condensedArray;
38
+ };
39
+ //# sourceMappingURL=strings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strings.js","sourceRoot":"","sources":["../../src/utils/strings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAiB,EAAE,SAAS,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,EAAY,EAAE;IAC9F,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,OAAO,CAAC;IAEvC,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,MAAM,eAAe,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,EAAE;QACvC,IAAI,CAAC,WAAW;YAAE,OAAO;QACzB,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,IAAI,KAAK;YAAE,WAAW,GAAG,EAAE,CAAC;IAC9B,CAAC,CAAC;IAEF,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACvB,IAAI,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;YAC7B,eAAe,EAAE,CAAC;YAClB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,IAAI,CAAC;YACnB,OAAO;QACT,CAAC;QAED,MAAM,YAAY,GAAG,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;QAC/C,IAAI,YAAY,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;YACrC,WAAW,GAAG,YAAY,CAAC;YAC3B,OAAO;QACT,CAAC;QAED,eAAe,CAAC,KAAK,CAAC,CAAC;QACvB,WAAW,GAAG,IAAI,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,eAAe,CAAC,KAAK,CAAC,CAAC;IAEvB,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC"}