seyfert 0.1.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 (345) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +57 -0
  3. package/lib/api/CDN.d.ts +220 -0
  4. package/lib/api/CDN.js +236 -0
  5. package/lib/api/REST.d.ts +127 -0
  6. package/lib/api/REST.js +424 -0
  7. package/lib/api/Router.d.ts +17 -0
  8. package/lib/api/Router.js +63 -0
  9. package/lib/api/Routes/applications.d.ts +46 -0
  10. package/lib/api/Routes/applications.js +2 -0
  11. package/lib/api/Routes/cdn.d.ts +66 -0
  12. package/lib/api/Routes/cdn.js +2 -0
  13. package/lib/api/Routes/channels.d.ts +109 -0
  14. package/lib/api/Routes/channels.js +2 -0
  15. package/lib/api/Routes/gateway.d.ts +11 -0
  16. package/lib/api/Routes/gateway.js +2 -0
  17. package/lib/api/Routes/guilds.d.ts +171 -0
  18. package/lib/api/Routes/guilds.js +2 -0
  19. package/lib/api/Routes/index.d.ts +13 -0
  20. package/lib/api/Routes/index.js +17 -0
  21. package/lib/api/Routes/interactions.d.ts +14 -0
  22. package/lib/api/Routes/interactions.js +2 -0
  23. package/lib/api/Routes/invites.d.ts +9 -0
  24. package/lib/api/Routes/invites.js +2 -0
  25. package/lib/api/Routes/stage-instances.d.ts +13 -0
  26. package/lib/api/Routes/stage-instances.js +2 -0
  27. package/lib/api/Routes/stickers.d.ts +11 -0
  28. package/lib/api/Routes/stickers.js +2 -0
  29. package/lib/api/Routes/users.d.ts +35 -0
  30. package/lib/api/Routes/users.js +2 -0
  31. package/lib/api/Routes/voice.d.ts +10 -0
  32. package/lib/api/Routes/voice.js +2 -0
  33. package/lib/api/Routes/webhooks.d.ts +29 -0
  34. package/lib/api/Routes/webhooks.js +2 -0
  35. package/lib/api/errors/DiscordAPIError.d.ts +51 -0
  36. package/lib/api/errors/DiscordAPIError.js +81 -0
  37. package/lib/api/errors/HTTPError.d.ts +20 -0
  38. package/lib/api/errors/HTTPError.js +28 -0
  39. package/lib/api/errors/RateLimitError.d.ts +19 -0
  40. package/lib/api/errors/RateLimitError.js +37 -0
  41. package/lib/api/handlers/BurstHandler.d.ts +51 -0
  42. package/lib/api/handlers/BurstHandler.js +124 -0
  43. package/lib/api/handlers/SequentialHandler.d.ts +81 -0
  44. package/lib/api/handlers/SequentialHandler.js +365 -0
  45. package/lib/api/handlers/Shared.d.ts +14 -0
  46. package/lib/api/handlers/Shared.js +125 -0
  47. package/lib/api/index.d.ts +5 -0
  48. package/lib/api/index.js +21 -0
  49. package/lib/api/interfaces/Handler.d.ts +21 -0
  50. package/lib/api/interfaces/Handler.js +2 -0
  51. package/lib/api/shared.d.ts +7 -0
  52. package/lib/api/shared.js +27 -0
  53. package/lib/api/utils/constants.d.ts +39 -0
  54. package/lib/api/utils/constants.js +50 -0
  55. package/lib/api/utils/types.d.ts +335 -0
  56. package/lib/api/utils/types.js +14 -0
  57. package/lib/api/utils/utils.d.ts +52 -0
  58. package/lib/api/utils/utils.js +159 -0
  59. package/lib/builders/ActionRow.d.ts +40 -0
  60. package/lib/builders/ActionRow.js +58 -0
  61. package/lib/builders/Attachment.d.ts +106 -0
  62. package/lib/builders/Attachment.js +196 -0
  63. package/lib/builders/Base.d.ts +10 -0
  64. package/lib/builders/Base.js +13 -0
  65. package/lib/builders/Button.d.ts +59 -0
  66. package/lib/builders/Button.js +94 -0
  67. package/lib/builders/MessageEmbed.d.ts +116 -0
  68. package/lib/builders/MessageEmbed.js +159 -0
  69. package/lib/builders/Modal.d.ts +111 -0
  70. package/lib/builders/Modal.js +162 -0
  71. package/lib/builders/SelectMenu.d.ts +201 -0
  72. package/lib/builders/SelectMenu.js +293 -0
  73. package/lib/builders/index.d.ts +12 -0
  74. package/lib/builders/index.js +54 -0
  75. package/lib/builders/types.d.ts +21 -0
  76. package/lib/builders/types.js +2 -0
  77. package/lib/cache/adapters/default.d.ts +24 -0
  78. package/lib/cache/adapters/default.js +118 -0
  79. package/lib/cache/adapters/index.d.ts +4 -0
  80. package/lib/cache/adapters/index.js +20 -0
  81. package/lib/cache/adapters/redis.d.ts +35 -0
  82. package/lib/cache/adapters/redis.js +180 -0
  83. package/lib/cache/adapters/types.d.ts +25 -0
  84. package/lib/cache/adapters/types.js +2 -0
  85. package/lib/cache/adapters/workeradapter.d.ts +24 -0
  86. package/lib/cache/adapters/workeradapter.js +76 -0
  87. package/lib/cache/index.d.ts +97 -0
  88. package/lib/cache/index.js +394 -0
  89. package/lib/cache/resources/channels.d.ts +7 -0
  90. package/lib/cache/resources/channels.js +20 -0
  91. package/lib/cache/resources/default/base.d.ts +25 -0
  92. package/lib/cache/resources/default/base.js +75 -0
  93. package/lib/cache/resources/default/guild-based.d.ts +33 -0
  94. package/lib/cache/resources/default/guild-based.js +91 -0
  95. package/lib/cache/resources/default/guild-related.d.ts +32 -0
  96. package/lib/cache/resources/default/guild-related.js +102 -0
  97. package/lib/cache/resources/emojis.d.ts +7 -0
  98. package/lib/cache/resources/emojis.js +17 -0
  99. package/lib/cache/resources/guilds.d.ts +10 -0
  100. package/lib/cache/resources/guilds.js +117 -0
  101. package/lib/cache/resources/members.d.ts +10 -0
  102. package/lib/cache/resources/members.js +41 -0
  103. package/lib/cache/resources/presence.d.ts +9 -0
  104. package/lib/cache/resources/presence.js +14 -0
  105. package/lib/cache/resources/roles.d.ts +7 -0
  106. package/lib/cache/resources/roles.js +17 -0
  107. package/lib/cache/resources/stage-instances.d.ts +5 -0
  108. package/lib/cache/resources/stage-instances.js +8 -0
  109. package/lib/cache/resources/stickers.d.ts +7 -0
  110. package/lib/cache/resources/stickers.js +17 -0
  111. package/lib/cache/resources/threads.d.ts +7 -0
  112. package/lib/cache/resources/threads.js +17 -0
  113. package/lib/cache/resources/users.d.ts +7 -0
  114. package/lib/cache/resources/users.js +17 -0
  115. package/lib/cache/resources/voice-states.d.ts +9 -0
  116. package/lib/cache/resources/voice-states.js +13 -0
  117. package/lib/client/base.d.ts +244 -0
  118. package/lib/client/base.js +178 -0
  119. package/lib/client/client.d.ts +32 -0
  120. package/lib/client/client.js +156 -0
  121. package/lib/client/httpclient.d.ts +21 -0
  122. package/lib/client/httpclient.js +143 -0
  123. package/lib/client/index.d.ts +4 -0
  124. package/lib/client/index.js +19 -0
  125. package/lib/client/oninteraction.d.ts +4 -0
  126. package/lib/client/oninteraction.js +180 -0
  127. package/lib/client/workerclient.d.ts +28 -0
  128. package/lib/client/workerclient.js +213 -0
  129. package/lib/collection.d.ts +233 -0
  130. package/lib/collection.js +371 -0
  131. package/lib/commands/applications/chat.d.ts +139 -0
  132. package/lib/commands/applications/chat.js +173 -0
  133. package/lib/commands/applications/chatcontext.d.ts +28 -0
  134. package/lib/commands/applications/chatcontext.js +53 -0
  135. package/lib/commands/applications/menu.d.ts +39 -0
  136. package/lib/commands/applications/menu.js +87 -0
  137. package/lib/commands/applications/menucontext.d.ts +25 -0
  138. package/lib/commands/applications/menucontext.js +64 -0
  139. package/lib/commands/applications/options.d.ts +67 -0
  140. package/lib/commands/applications/options.js +44 -0
  141. package/lib/commands/applications/shared.d.ts +35 -0
  142. package/lib/commands/applications/shared.js +2 -0
  143. package/lib/commands/decorators.d.ts +107 -0
  144. package/lib/commands/decorators.js +85 -0
  145. package/lib/commands/handler.d.ts +15 -0
  146. package/lib/commands/handler.js +140 -0
  147. package/lib/commands/index.d.ts +8 -0
  148. package/lib/commands/index.js +24 -0
  149. package/lib/commands/optionresolver.d.ts +49 -0
  150. package/lib/commands/optionresolver.js +146 -0
  151. package/lib/common/bot/watcher.d.ts +53 -0
  152. package/lib/common/bot/watcher.js +104 -0
  153. package/lib/common/index.d.ts +13 -0
  154. package/lib/common/index.js +30 -0
  155. package/lib/common/it/colors.d.ts +274 -0
  156. package/lib/common/it/colors.js +453 -0
  157. package/lib/common/it/constants.d.ts +36 -0
  158. package/lib/common/it/constants.js +40 -0
  159. package/lib/common/it/logger.d.ts +114 -0
  160. package/lib/common/it/logger.js +189 -0
  161. package/lib/common/it/utils.d.ts +107 -0
  162. package/lib/common/it/utils.js +275 -0
  163. package/lib/common/shorters/base.d.ts +5 -0
  164. package/lib/common/shorters/base.js +10 -0
  165. package/lib/common/shorters/channels.d.ts +90 -0
  166. package/lib/common/shorters/channels.js +95 -0
  167. package/lib/common/shorters/guilds.d.ts +389 -0
  168. package/lib/common/shorters/guilds.js +350 -0
  169. package/lib/common/shorters/members.d.ts +115 -0
  170. package/lib/common/shorters/members.js +179 -0
  171. package/lib/common/shorters/messages.d.ts +27 -0
  172. package/lib/common/shorters/messages.js +117 -0
  173. package/lib/common/shorters/roles.d.ts +12 -0
  174. package/lib/common/shorters/roles.js +51 -0
  175. package/lib/common/shorters/templates.d.ts +12 -0
  176. package/lib/common/shorters/templates.js +29 -0
  177. package/lib/common/shorters/users.d.ts +11 -0
  178. package/lib/common/shorters/users.js +42 -0
  179. package/lib/common/shorters/webhook.d.ts +33 -0
  180. package/lib/common/shorters/webhook.js +69 -0
  181. package/lib/common/types/options.d.ts +10 -0
  182. package/lib/common/types/options.js +2 -0
  183. package/lib/common/types/resolvables.d.ts +10 -0
  184. package/lib/common/types/resolvables.js +2 -0
  185. package/lib/common/types/util.d.ts +90 -0
  186. package/lib/common/types/util.js +2 -0
  187. package/lib/common/types/write.d.ts +21 -0
  188. package/lib/common/types/write.js +2 -0
  189. package/lib/components/ActionRow.d.ts +10 -0
  190. package/lib/components/ActionRow.js +13 -0
  191. package/lib/components/ButtonComponent.d.ts +19 -0
  192. package/lib/components/ButtonComponent.js +34 -0
  193. package/lib/components/ChannelSelectMenuComponent.d.ts +6 -0
  194. package/lib/components/ChannelSelectMenuComponent.js +12 -0
  195. package/lib/components/MentionableSelectMenuComponent.d.ts +4 -0
  196. package/lib/components/MentionableSelectMenuComponent.js +7 -0
  197. package/lib/components/RoleSelectMenuComponent.d.ts +4 -0
  198. package/lib/components/RoleSelectMenuComponent.js +7 -0
  199. package/lib/components/StringSelectMenuComponent.d.ts +6 -0
  200. package/lib/components/StringSelectMenuComponent.js +12 -0
  201. package/lib/components/TextInputComponent.d.ts +7 -0
  202. package/lib/components/TextInputComponent.js +14 -0
  203. package/lib/components/UserSelectMenuComponent.d.ts +4 -0
  204. package/lib/components/UserSelectMenuComponent.js +7 -0
  205. package/lib/components/command.d.ts +23 -0
  206. package/lib/components/command.js +15 -0
  207. package/lib/components/handler.d.ts +48 -0
  208. package/lib/components/handler.js +231 -0
  209. package/lib/components/index.d.ts +20 -0
  210. package/lib/components/index.js +55 -0
  211. package/lib/components/listener.d.ts +11 -0
  212. package/lib/components/listener.js +18 -0
  213. package/lib/events/event.d.ts +23 -0
  214. package/lib/events/event.js +2 -0
  215. package/lib/events/handler.d.ts +19 -0
  216. package/lib/events/handler.js +112 -0
  217. package/lib/events/hooks/application_command.d.ts +12 -0
  218. package/lib/events/hooks/application_command.js +8 -0
  219. package/lib/events/hooks/auto_moderation.d.ts +22 -0
  220. package/lib/events/hooks/auto_moderation.js +21 -0
  221. package/lib/events/hooks/channel.d.ts +11 -0
  222. package/lib/events/hooks/channel.js +24 -0
  223. package/lib/events/hooks/custom.d.ts +4 -0
  224. package/lib/events/hooks/custom.js +11 -0
  225. package/lib/events/hooks/dispatch.d.ts +5 -0
  226. package/lib/events/hooks/dispatch.js +12 -0
  227. package/lib/events/hooks/entitlement.d.ts +35 -0
  228. package/lib/events/hooks/entitlement.js +16 -0
  229. package/lib/events/hooks/guild.d.ts +228 -0
  230. package/lib/events/hooks/guild.js +101 -0
  231. package/lib/events/hooks/index.d.ts +23 -0
  232. package/lib/events/hooks/index.js +34 -0
  233. package/lib/events/hooks/integration.d.ts +94 -0
  234. package/lib/events/hooks/integration.js +27 -0
  235. package/lib/events/hooks/interactions.d.ts +4 -0
  236. package/lib/events/hooks/interactions.js +8 -0
  237. package/lib/events/hooks/invite.d.ts +21 -0
  238. package/lib/events/hooks/invite.js +12 -0
  239. package/lib/events/hooks/message.d.ts +69 -0
  240. package/lib/events/hooks/message.js +37 -0
  241. package/lib/events/hooks/presence.d.ts +27 -0
  242. package/lib/events/hooks/presence.js +8 -0
  243. package/lib/events/hooks/stage.d.ts +29 -0
  244. package/lib/events/hooks/stage.js +16 -0
  245. package/lib/events/hooks/thread.d.ts +198 -0
  246. package/lib/events/hooks/thread.js +29 -0
  247. package/lib/events/hooks/typing.d.ts +16 -0
  248. package/lib/events/hooks/typing.js +14 -0
  249. package/lib/events/hooks/user.d.ts +4 -0
  250. package/lib/events/hooks/user.js +8 -0
  251. package/lib/events/hooks/voice.d.ts +37 -0
  252. package/lib/events/hooks/voice.js +18 -0
  253. package/lib/events/hooks/webhook.d.ts +6 -0
  254. package/lib/events/hooks/webhook.js +8 -0
  255. package/lib/events/index.d.ts +2 -0
  256. package/lib/events/index.js +18 -0
  257. package/lib/index.d.ts +79 -0
  258. package/lib/index.js +104 -0
  259. package/lib/langs/handler.d.ts +11 -0
  260. package/lib/langs/handler.js +34 -0
  261. package/lib/langs/index.d.ts +2 -0
  262. package/lib/langs/index.js +18 -0
  263. package/lib/langs/router.d.ts +18 -0
  264. package/lib/langs/router.js +42 -0
  265. package/lib/structures/AnonymousGuild.d.ts +7 -0
  266. package/lib/structures/AnonymousGuild.js +11 -0
  267. package/lib/structures/AutoModerationRule.d.ts +22 -0
  268. package/lib/structures/AutoModerationRule.js +34 -0
  269. package/lib/structures/ClientUser.d.ts +25 -0
  270. package/lib/structures/ClientUser.js +52 -0
  271. package/lib/structures/Guild.d.ts +86 -0
  272. package/lib/structures/Guild.js +66 -0
  273. package/lib/structures/GuildEmoji.d.ts +29 -0
  274. package/lib/structures/GuildEmoji.js +47 -0
  275. package/lib/structures/GuildMember.d.ts +92 -0
  276. package/lib/structures/GuildMember.js +137 -0
  277. package/lib/structures/GuildPreview.d.ts +10 -0
  278. package/lib/structures/GuildPreview.js +14 -0
  279. package/lib/structures/GuildRole.d.ts +21 -0
  280. package/lib/structures/GuildRole.js +32 -0
  281. package/lib/structures/GuildTemplate.d.ts +23 -0
  282. package/lib/structures/GuildTemplate.js +36 -0
  283. package/lib/structures/Interaction.d.ts +152 -0
  284. package/lib/structures/Interaction.js +409 -0
  285. package/lib/structures/Message.d.ts +53 -0
  286. package/lib/structures/Message.js +123 -0
  287. package/lib/structures/Sticker.d.ts +27 -0
  288. package/lib/structures/Sticker.js +44 -0
  289. package/lib/structures/User.d.ts +20 -0
  290. package/lib/structures/User.js +37 -0
  291. package/lib/structures/Webhook.d.ts +42 -0
  292. package/lib/structures/Webhook.js +63 -0
  293. package/lib/structures/channels.d.ts +232 -0
  294. package/lib/structures/channels.js +366 -0
  295. package/lib/structures/extra/Base.d.ts +7 -0
  296. package/lib/structures/extra/Base.js +39 -0
  297. package/lib/structures/extra/BaseComponent.d.ts +9 -0
  298. package/lib/structures/extra/BaseComponent.js +12 -0
  299. package/lib/structures/extra/BaseGuild.d.ts +40 -0
  300. package/lib/structures/extra/BaseGuild.js +71 -0
  301. package/lib/structures/extra/BaseSelectMenuComponent.d.ts +9 -0
  302. package/lib/structures/extra/BaseSelectMenuComponent.js +13 -0
  303. package/lib/structures/extra/BitField.d.ts +14 -0
  304. package/lib/structures/extra/BitField.js +56 -0
  305. package/lib/structures/extra/DiscordBase.d.ts +18 -0
  306. package/lib/structures/extra/DiscordBase.js +28 -0
  307. package/lib/structures/extra/Permissions.d.ts +54 -0
  308. package/lib/structures/extra/Permissions.js +9 -0
  309. package/lib/structures/extra/functions.d.ts +11 -0
  310. package/lib/structures/extra/functions.js +69 -0
  311. package/lib/structures/index.d.ts +15 -0
  312. package/lib/structures/index.js +31 -0
  313. package/lib/websocket/SharedTypes.d.ts +128 -0
  314. package/lib/websocket/SharedTypes.js +2 -0
  315. package/lib/websocket/constants/index.d.ts +26 -0
  316. package/lib/websocket/constants/index.js +31 -0
  317. package/lib/websocket/discord/basesocket.d.ts +12 -0
  318. package/lib/websocket/discord/basesocket.js +37 -0
  319. package/lib/websocket/discord/events/memberUpdate.d.ts +16 -0
  320. package/lib/websocket/discord/events/memberUpdate.js +47 -0
  321. package/lib/websocket/discord/events/presenceUpdate.d.ts +24 -0
  322. package/lib/websocket/discord/events/presenceUpdate.js +46 -0
  323. package/lib/websocket/discord/handlemessage.d.ts +0 -0
  324. package/lib/websocket/discord/handlemessage.js +1 -0
  325. package/lib/websocket/discord/index.d.ts +4 -0
  326. package/lib/websocket/discord/index.js +20 -0
  327. package/lib/websocket/discord/memberUpdate.d.ts +16 -0
  328. package/lib/websocket/discord/memberUpdate.js +47 -0
  329. package/lib/websocket/discord/shard.d.ts +46 -0
  330. package/lib/websocket/discord/shard.js +278 -0
  331. package/lib/websocket/discord/sharder.d.ts +25 -0
  332. package/lib/websocket/discord/sharder.js +153 -0
  333. package/lib/websocket/discord/shared.d.ts +99 -0
  334. package/lib/websocket/discord/shared.js +8 -0
  335. package/lib/websocket/discord/worker.d.ts +43 -0
  336. package/lib/websocket/discord/worker.js +2 -0
  337. package/lib/websocket/discord/workermanager.d.ts +69 -0
  338. package/lib/websocket/discord/workermanager.js +273 -0
  339. package/lib/websocket/index.d.ts +3 -0
  340. package/lib/websocket/index.js +19 -0
  341. package/lib/websocket/structures/index.d.ts +117 -0
  342. package/lib/websocket/structures/index.js +261 -0
  343. package/lib/websocket/structures/timeout.d.ts +20 -0
  344. package/lib/websocket/structures/timeout.js +75 -0
  345. package/package.json +70 -0
@@ -0,0 +1,453 @@
1
+ "use strict";
2
+ // https://github.com/discordeno/discordeno/blob/main/packages/utils/src/colors.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.stripColor = exports.bgRgb24 = exports.rgb24 = exports.bgRgb8 = exports.rgb8 = exports.bgBrightWhite = exports.bgBrightCyan = exports.bgBrightMagenta = exports.bgBrightBlue = exports.bgBrightYellow = exports.bgBrightGreen = exports.bgBrightRed = exports.bgBrightBlack = exports.bgWhite = exports.bgCyan = exports.bgMagenta = exports.bgBlue = exports.bgYellow = exports.bgGreen = exports.bgRed = exports.bgBlack = exports.brightWhite = exports.brightCyan = exports.brightMagenta = exports.brightBlue = exports.brightYellow = exports.brightGreen = exports.brightRed = exports.brightBlack = exports.gray = exports.white = exports.cyan = exports.magenta = exports.blue = exports.yellow = exports.green = exports.red = exports.black = exports.strikethrough = exports.hidden = exports.inverse = exports.underline = exports.italic = exports.dim = exports.bold = exports.reset = exports.getColorEnabled = exports.setColorEnabled = void 0;
5
+ let enabled = true;
6
+ /**
7
+ * Set changing text color to enabled or disabled
8
+ * @param value
9
+ */
10
+ function setColorEnabled(value) {
11
+ enabled = value;
12
+ }
13
+ exports.setColorEnabled = setColorEnabled;
14
+ /** Get whether text color change is enabled or disabled. */
15
+ function getColorEnabled() {
16
+ return enabled;
17
+ }
18
+ exports.getColorEnabled = getColorEnabled;
19
+ /**
20
+ * Builds color code
21
+ * @param open
22
+ * @param close
23
+ */
24
+ function code(open, close) {
25
+ return {
26
+ open: `\x1b[${open.join(';')}m`,
27
+ close: `\x1b[${close}m`,
28
+ regexp: new RegExp(`\\x1b\\[${close}m`, 'g'),
29
+ };
30
+ }
31
+ /**
32
+ * Applies color and background based on color code and its associated text
33
+ * @param str text to apply color settings to
34
+ * @param code color code to apply
35
+ */
36
+ function run(str, code) {
37
+ return enabled ? `${code.open}${str.replace(code.regexp, code.open)}${code.close}` : str;
38
+ }
39
+ /**
40
+ * Reset the text modified
41
+ * @param str text to reset
42
+ */
43
+ function reset(str) {
44
+ return run(str, code([0], 0));
45
+ }
46
+ exports.reset = reset;
47
+ /**
48
+ * Make the text bold.
49
+ * @param str text to make bold
50
+ */
51
+ function bold(str) {
52
+ return run(str, code([1], 22));
53
+ }
54
+ exports.bold = bold;
55
+ /**
56
+ * The text emits only a small amount of light.
57
+ * @param str text to dim
58
+ */
59
+ function dim(str) {
60
+ return run(str, code([2], 22));
61
+ }
62
+ exports.dim = dim;
63
+ /**
64
+ * Make the text italic.
65
+ * @param str text to make italic
66
+ */
67
+ function italic(str) {
68
+ return run(str, code([3], 23));
69
+ }
70
+ exports.italic = italic;
71
+ /**
72
+ * Make the text underline.
73
+ * @param str text to underline
74
+ */
75
+ function underline(str) {
76
+ return run(str, code([4], 24));
77
+ }
78
+ exports.underline = underline;
79
+ /**
80
+ * Invert background color and text color.
81
+ * @param str text to invert its color
82
+ */
83
+ function inverse(str) {
84
+ return run(str, code([7], 27));
85
+ }
86
+ exports.inverse = inverse;
87
+ /**
88
+ * Make the text hidden.
89
+ * @param str text to hide
90
+ */
91
+ function hidden(str) {
92
+ return run(str, code([8], 28));
93
+ }
94
+ exports.hidden = hidden;
95
+ /**
96
+ * Put horizontal line through the center of the text.
97
+ * @param str text to strike through
98
+ */
99
+ function strikethrough(str) {
100
+ return run(str, code([9], 29));
101
+ }
102
+ exports.strikethrough = strikethrough;
103
+ /**
104
+ * Set text color to black.
105
+ * @param str text to make black
106
+ */
107
+ function black(str) {
108
+ return run(str, code([30], 39));
109
+ }
110
+ exports.black = black;
111
+ /**
112
+ * Set text color to red.
113
+ * @param str text to make red
114
+ */
115
+ function red(str) {
116
+ return run(str, code([31], 39));
117
+ }
118
+ exports.red = red;
119
+ /**
120
+ * Set text color to green.
121
+ * @param str text to make green
122
+ */
123
+ function green(str) {
124
+ return run(str, code([32], 39));
125
+ }
126
+ exports.green = green;
127
+ /**
128
+ * Set text color to yellow.
129
+ * @param str text to make yellow
130
+ */
131
+ function yellow(str) {
132
+ return run(str, code([33], 39));
133
+ }
134
+ exports.yellow = yellow;
135
+ /**
136
+ * Set text color to blue.
137
+ * @param str text to make blue
138
+ */
139
+ function blue(str) {
140
+ return run(str, code([34], 39));
141
+ }
142
+ exports.blue = blue;
143
+ /**
144
+ * Set text color to magenta.
145
+ * @param str text to make magenta
146
+ */
147
+ function magenta(str) {
148
+ return run(str, code([35], 39));
149
+ }
150
+ exports.magenta = magenta;
151
+ /**
152
+ * Set text color to cyan.
153
+ * @param str text to make cyan
154
+ */
155
+ function cyan(str) {
156
+ return run(str, code([36], 39));
157
+ }
158
+ exports.cyan = cyan;
159
+ /**
160
+ * Set text color to white.
161
+ * @param str text to make white
162
+ */
163
+ function white(str) {
164
+ return run(str, code([37], 39));
165
+ }
166
+ exports.white = white;
167
+ /**
168
+ * Set text color to gray.
169
+ * @param str text to make gray
170
+ */
171
+ function gray(str) {
172
+ return brightBlack(str);
173
+ }
174
+ exports.gray = gray;
175
+ /**
176
+ * Set text color to bright black.
177
+ * @param str text to make bright-black
178
+ */
179
+ function brightBlack(str) {
180
+ return run(str, code([90], 39));
181
+ }
182
+ exports.brightBlack = brightBlack;
183
+ /**
184
+ * Set text color to bright red.
185
+ * @param str text to make bright-red
186
+ */
187
+ function brightRed(str) {
188
+ return run(str, code([91], 39));
189
+ }
190
+ exports.brightRed = brightRed;
191
+ /**
192
+ * Set text color to bright green.
193
+ * @param str text to make bright-green
194
+ */
195
+ function brightGreen(str) {
196
+ return run(str, code([92], 39));
197
+ }
198
+ exports.brightGreen = brightGreen;
199
+ /**
200
+ * Set text color to bright yellow.
201
+ * @param str text to make bright-yellow
202
+ */
203
+ function brightYellow(str) {
204
+ return run(str, code([93], 39));
205
+ }
206
+ exports.brightYellow = brightYellow;
207
+ /**
208
+ * Set text color to bright blue.
209
+ * @param str text to make bright-blue
210
+ */
211
+ function brightBlue(str) {
212
+ return run(str, code([94], 39));
213
+ }
214
+ exports.brightBlue = brightBlue;
215
+ /**
216
+ * Set text color to bright magenta.
217
+ * @param str text to make bright-magenta
218
+ */
219
+ function brightMagenta(str) {
220
+ return run(str, code([95], 39));
221
+ }
222
+ exports.brightMagenta = brightMagenta;
223
+ /**
224
+ * Set text color to bright cyan.
225
+ * @param str text to make bright-cyan
226
+ */
227
+ function brightCyan(str) {
228
+ return run(str, code([96], 39));
229
+ }
230
+ exports.brightCyan = brightCyan;
231
+ /**
232
+ * Set text color to bright white.
233
+ * @param str text to make bright-white
234
+ */
235
+ function brightWhite(str) {
236
+ return run(str, code([97], 39));
237
+ }
238
+ exports.brightWhite = brightWhite;
239
+ /**
240
+ * Set background color to black.
241
+ * @param str text to make its background black
242
+ */
243
+ function bgBlack(str) {
244
+ return run(str, code([40], 49));
245
+ }
246
+ exports.bgBlack = bgBlack;
247
+ /**
248
+ * Set background color to red.
249
+ * @param str text to make its background red
250
+ */
251
+ function bgRed(str) {
252
+ return run(str, code([41], 49));
253
+ }
254
+ exports.bgRed = bgRed;
255
+ /**
256
+ * Set background color to green.
257
+ * @param str text to make its background green
258
+ */
259
+ function bgGreen(str) {
260
+ return run(str, code([42], 49));
261
+ }
262
+ exports.bgGreen = bgGreen;
263
+ /**
264
+ * Set background color to yellow.
265
+ * @param str text to make its background yellow
266
+ */
267
+ function bgYellow(str) {
268
+ return run(str, code([43], 49));
269
+ }
270
+ exports.bgYellow = bgYellow;
271
+ /**
272
+ * Set background color to blue.
273
+ * @param str text to make its background blue
274
+ */
275
+ function bgBlue(str) {
276
+ return run(str, code([44], 49));
277
+ }
278
+ exports.bgBlue = bgBlue;
279
+ /**
280
+ * Set background color to magenta.
281
+ * @param str text to make its background magenta
282
+ */
283
+ function bgMagenta(str) {
284
+ return run(str, code([45], 49));
285
+ }
286
+ exports.bgMagenta = bgMagenta;
287
+ /**
288
+ * Set background color to cyan.
289
+ * @param str text to make its background cyan
290
+ */
291
+ function bgCyan(str) {
292
+ return run(str, code([46], 49));
293
+ }
294
+ exports.bgCyan = bgCyan;
295
+ /**
296
+ * Set background color to white.
297
+ * @param str text to make its background white
298
+ */
299
+ function bgWhite(str) {
300
+ return run(str, code([47], 49));
301
+ }
302
+ exports.bgWhite = bgWhite;
303
+ /**
304
+ * Set background color to bright black.
305
+ * @param str text to make its background bright-black
306
+ */
307
+ function bgBrightBlack(str) {
308
+ return run(str, code([100], 49));
309
+ }
310
+ exports.bgBrightBlack = bgBrightBlack;
311
+ /**
312
+ * Set background color to bright red.
313
+ * @param str text to make its background bright-red
314
+ */
315
+ function bgBrightRed(str) {
316
+ return run(str, code([101], 49));
317
+ }
318
+ exports.bgBrightRed = bgBrightRed;
319
+ /**
320
+ * Set background color to bright green.
321
+ * @param str text to make its background bright-green
322
+ */
323
+ function bgBrightGreen(str) {
324
+ return run(str, code([102], 49));
325
+ }
326
+ exports.bgBrightGreen = bgBrightGreen;
327
+ /**
328
+ * Set background color to bright yellow.
329
+ * @param str text to make its background bright-yellow
330
+ */
331
+ function bgBrightYellow(str) {
332
+ return run(str, code([103], 49));
333
+ }
334
+ exports.bgBrightYellow = bgBrightYellow;
335
+ /**
336
+ * Set background color to bright blue.
337
+ * @param str text to make its background bright-blue
338
+ */
339
+ function bgBrightBlue(str) {
340
+ return run(str, code([104], 49));
341
+ }
342
+ exports.bgBrightBlue = bgBrightBlue;
343
+ /**
344
+ * Set background color to bright magenta.
345
+ * @param str text to make its background bright-magenta
346
+ */
347
+ function bgBrightMagenta(str) {
348
+ return run(str, code([105], 49));
349
+ }
350
+ exports.bgBrightMagenta = bgBrightMagenta;
351
+ /**
352
+ * Set background color to bright cyan.
353
+ * @param str text to make its background bright-cyan
354
+ */
355
+ function bgBrightCyan(str) {
356
+ return run(str, code([106], 49));
357
+ }
358
+ exports.bgBrightCyan = bgBrightCyan;
359
+ /**
360
+ * Set background color to bright white.
361
+ * @param str text to make its background bright-white
362
+ */
363
+ function bgBrightWhite(str) {
364
+ return run(str, code([107], 49));
365
+ }
366
+ exports.bgBrightWhite = bgBrightWhite;
367
+ /* Special Color Sequences */
368
+ /**
369
+ * Clam and truncate color codes
370
+ * @param n
371
+ * @param max number to truncate to
372
+ * @param min number to truncate from
373
+ */
374
+ function clampAndTruncate(n, max = 255, min = 0) {
375
+ return Math.trunc(Math.max(Math.min(n, max), min));
376
+ }
377
+ /**
378
+ * Set text color using paletted 8bit colors.
379
+ * https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
380
+ * @param str text color to apply paletted 8bit colors to
381
+ * @param color code
382
+ */
383
+ function rgb8(str, color) {
384
+ return run(str, code([38, 5, clampAndTruncate(color)], 39));
385
+ }
386
+ exports.rgb8 = rgb8;
387
+ /**
388
+ * Set background color using paletted 8bit colors.
389
+ * https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
390
+ * @param str text color to apply paletted 8bit background colors to
391
+ * @param color code
392
+ */
393
+ function bgRgb8(str, color) {
394
+ return run(str, code([48, 5, clampAndTruncate(color)], 49));
395
+ }
396
+ exports.bgRgb8 = bgRgb8;
397
+ /**
398
+ * Set text color using 24bit rgb.
399
+ * `color` can be a number in range `0x000000` to `0xffffff` or
400
+ * an `Rgb`.
401
+ *
402
+ * To produce the color magenta:
403
+ *
404
+ * ```ts
405
+ * import { rgb24 } from "./colors.ts";
406
+ * rgb24("foo", 0xff00ff);
407
+ * rgb24("foo", {r: 255, g: 0, b: 255});
408
+ * ```
409
+ * @param str text color to apply 24bit rgb to
410
+ * @param color code
411
+ */
412
+ function rgb24(str, color) {
413
+ if (typeof color === 'number') {
414
+ return run(str, code([38, 2, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff], 39));
415
+ }
416
+ return run(str, code([38, 2, clampAndTruncate(color.r), clampAndTruncate(color.g), clampAndTruncate(color.b)], 39));
417
+ }
418
+ exports.rgb24 = rgb24;
419
+ /**
420
+ * Set background color using 24bit rgb.
421
+ * `color` can be a number in range `0x000000` to `0xffffff` or
422
+ * an `Rgb`.
423
+ *
424
+ * To produce the color magenta:
425
+ *
426
+ * ```ts
427
+ * import { bgRgb24 } from "./colors.ts";
428
+ * bgRgb24("foo", 0xff00ff);
429
+ * bgRgb24("foo", {r: 255, g: 0, b: 255});
430
+ * ```
431
+ * @param str text color to apply 24bit rgb to
432
+ * @param color code
433
+ */
434
+ function bgRgb24(str, color) {
435
+ if (typeof color === 'number') {
436
+ return run(str, code([48, 2, (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff], 49));
437
+ }
438
+ return run(str, code([48, 2, clampAndTruncate(color.r), clampAndTruncate(color.g), clampAndTruncate(color.b)], 49));
439
+ }
440
+ exports.bgRgb24 = bgRgb24;
441
+ // https://github.com/chalk/ansi-regex/blob/02fa893d619d3da85411acc8fd4e2eea0e95a9d9/index.js
442
+ const ANSI_PATTERN = new RegExp([
443
+ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
444
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
445
+ ].join('|'), 'g');
446
+ /**
447
+ * Remove ANSI escape codes from the string.
448
+ * @param string to remove ANSI escape codes from
449
+ */
450
+ function stripColor(string) {
451
+ return string.replace(ANSI_PATTERN, '');
452
+ }
453
+ exports.stripColor = stripColor;
@@ -0,0 +1,36 @@
1
+ export declare enum EmbedColors {
2
+ Default = 0,
3
+ White = 16777215,
4
+ Aqua = 1752220,
5
+ Green = 5763719,
6
+ Blue = 3447003,
7
+ Yellow = 16705372,
8
+ Purple = 10181046,
9
+ LuminousVividPink = 15277667,
10
+ Fuchsia = 15418782,
11
+ Gold = 15844367,
12
+ Orange = 15105570,
13
+ Red = 15548997,
14
+ Grey = 9807270,
15
+ Navy = 3426654,
16
+ DarkAqua = 1146986,
17
+ DarkGreen = 2067276,
18
+ DarkBlue = 2123412,
19
+ DarkPurple = 7419530,
20
+ DarkVividPink = 11342935,
21
+ DarkGold = 12745742,
22
+ DarkOrange = 11027200,
23
+ DarkRed = 10038562,
24
+ DarkGrey = 9936031,
25
+ DarkerGrey = 8359053,
26
+ LightGrey = 12370112,
27
+ DarkNavy = 2899536,
28
+ Blurple = 5793266,
29
+ Greyple = 10070709,
30
+ DarkButNotBlack = 2895667,
31
+ NotQuiteBlack = 2303786
32
+ }
33
+ export declare const DiscordEpoch = 1420070400000n;
34
+ export declare const BASE_HOST = "https://discord.com";
35
+ export declare const BASE_URL = "https://discord.com/api";
36
+ export declare const CDN_URL = "https://cdn.discordapp.com";
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDN_URL = exports.BASE_URL = exports.BASE_HOST = exports.DiscordEpoch = exports.EmbedColors = void 0;
4
+ var EmbedColors;
5
+ (function (EmbedColors) {
6
+ EmbedColors[EmbedColors["Default"] = 0] = "Default";
7
+ EmbedColors[EmbedColors["White"] = 16777215] = "White";
8
+ EmbedColors[EmbedColors["Aqua"] = 1752220] = "Aqua";
9
+ EmbedColors[EmbedColors["Green"] = 5763719] = "Green";
10
+ EmbedColors[EmbedColors["Blue"] = 3447003] = "Blue";
11
+ EmbedColors[EmbedColors["Yellow"] = 16705372] = "Yellow";
12
+ EmbedColors[EmbedColors["Purple"] = 10181046] = "Purple";
13
+ EmbedColors[EmbedColors["LuminousVividPink"] = 15277667] = "LuminousVividPink";
14
+ EmbedColors[EmbedColors["Fuchsia"] = 15418782] = "Fuchsia";
15
+ EmbedColors[EmbedColors["Gold"] = 15844367] = "Gold";
16
+ EmbedColors[EmbedColors["Orange"] = 15105570] = "Orange";
17
+ EmbedColors[EmbedColors["Red"] = 15548997] = "Red";
18
+ EmbedColors[EmbedColors["Grey"] = 9807270] = "Grey";
19
+ EmbedColors[EmbedColors["Navy"] = 3426654] = "Navy";
20
+ EmbedColors[EmbedColors["DarkAqua"] = 1146986] = "DarkAqua";
21
+ EmbedColors[EmbedColors["DarkGreen"] = 2067276] = "DarkGreen";
22
+ EmbedColors[EmbedColors["DarkBlue"] = 2123412] = "DarkBlue";
23
+ EmbedColors[EmbedColors["DarkPurple"] = 7419530] = "DarkPurple";
24
+ EmbedColors[EmbedColors["DarkVividPink"] = 11342935] = "DarkVividPink";
25
+ EmbedColors[EmbedColors["DarkGold"] = 12745742] = "DarkGold";
26
+ EmbedColors[EmbedColors["DarkOrange"] = 11027200] = "DarkOrange";
27
+ EmbedColors[EmbedColors["DarkRed"] = 10038562] = "DarkRed";
28
+ EmbedColors[EmbedColors["DarkGrey"] = 9936031] = "DarkGrey";
29
+ EmbedColors[EmbedColors["DarkerGrey"] = 8359053] = "DarkerGrey";
30
+ EmbedColors[EmbedColors["LightGrey"] = 12370112] = "LightGrey";
31
+ EmbedColors[EmbedColors["DarkNavy"] = 2899536] = "DarkNavy";
32
+ EmbedColors[EmbedColors["Blurple"] = 5793266] = "Blurple";
33
+ EmbedColors[EmbedColors["Greyple"] = 10070709] = "Greyple";
34
+ EmbedColors[EmbedColors["DarkButNotBlack"] = 2895667] = "DarkButNotBlack";
35
+ EmbedColors[EmbedColors["NotQuiteBlack"] = 2303786] = "NotQuiteBlack";
36
+ })(EmbedColors || (exports.EmbedColors = EmbedColors = {}));
37
+ exports.DiscordEpoch = 1420070400000n;
38
+ exports.BASE_HOST = 'https://discord.com';
39
+ exports.BASE_URL = `${exports.BASE_HOST}/api`;
40
+ exports.CDN_URL = 'https://cdn.discordapp.com';
@@ -0,0 +1,114 @@
1
+ export declare enum LogLevels {
2
+ Debug = 0,
3
+ Info = 1,
4
+ Warn = 2,
5
+ Error = 3,
6
+ Fatal = 4
7
+ }
8
+ export type LoggerOptions = {
9
+ logLevel?: LogLevels;
10
+ name?: string;
11
+ active?: boolean;
12
+ };
13
+ export type CustomCallback = (self: Logger, level: LogLevels, args: unknown[]) => unknown[];
14
+ /**
15
+ * Represents a logger utility for logging messages with various log levels.
16
+ */
17
+ export declare class Logger {
18
+ /**
19
+ * The options for configuring the logger.
20
+ */
21
+ readonly options: Required<LoggerOptions>;
22
+ /**
23
+ * The custom callback function for logging.
24
+ */
25
+ private static __callback?;
26
+ /**
27
+ * Allows customization of the logging behavior by providing a custom callback function.
28
+ * @param cb The custom callback function for logging.
29
+ * @example
30
+ * Logger.customize((logger, level, args) => {
31
+ * // Custom logging implementation
32
+ * });
33
+ */
34
+ static customize(cb: CustomCallback): void;
35
+ /**
36
+ * Constructs a new Logger instance with the provided options.
37
+ * @param options The options for configuring the logger.
38
+ */
39
+ constructor(options: LoggerOptions);
40
+ /**
41
+ * Sets the log level of the logger.
42
+ */
43
+ set level(level: LogLevels);
44
+ /**
45
+ * Gets the log level of the logger.
46
+ */
47
+ get level(): LogLevels;
48
+ /**
49
+ * Sets whether the logger is active or not.
50
+ */
51
+ set active(active: boolean);
52
+ /**
53
+ * Gets whether the logger is active or not.
54
+ */
55
+ get active(): boolean;
56
+ /**
57
+ * Sets the name of the logger.
58
+ */
59
+ set name(name: string);
60
+ /**
61
+ * Gets the name of the logger.
62
+ */
63
+ get name(): string;
64
+ /**
65
+ * Logs a message with the specified log level.
66
+ * @param level The log level.
67
+ * @param args The arguments to log.
68
+ * @returns The logged message.
69
+ */
70
+ rawLog(level: LogLevels, ...args: unknown[]): void;
71
+ /**
72
+ * Logs a debug message.
73
+ * @param args The arguments to log.
74
+ */
75
+ debug(...args: any[]): void;
76
+ /**
77
+ * Logs an info message.
78
+ * @param args The arguments to log.
79
+ */
80
+ info(...args: any[]): void;
81
+ /**
82
+ * Logs a warning message.
83
+ * @param args The arguments to log.
84
+ */
85
+ warn(...args: any[]): void;
86
+ /**
87
+ * Logs an error message.
88
+ * @param args The arguments to log.
89
+ */
90
+ error(...args: any[]): void;
91
+ /**
92
+ * Logs a fatal error message.
93
+ * @param args The arguments to log.
94
+ */
95
+ fatal(...args: any[]): void;
96
+ /**
97
+ * The default options for the logger.
98
+ */
99
+ static DEFAULT_OPTIONS: Required<LoggerOptions>;
100
+ /**
101
+ * A function that returns the input string as is, without any color modification.
102
+ * @param msg The message to log.
103
+ * @returns The input message as is.
104
+ */
105
+ static noColor(msg: string): string;
106
+ /**
107
+ * A map containing color functions for different log levels.
108
+ */
109
+ static colorFunctions: Map<LogLevels, (str: string) => string>;
110
+ /**
111
+ * A map containing prefixes for different log levels.
112
+ */
113
+ static prefixes: Map<LogLevels, string>;
114
+ }