seyfert 4.4.1 → 5.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 (231) hide show
  1. package/README.md +7 -1
  2. package/lib/api/Routes/cdn.d.ts +2 -2
  3. package/lib/api/Routes/guilds.d.ts +2 -2
  4. package/lib/api/Routes/invites.d.ts +2 -2
  5. package/lib/api/api.d.ts +20 -8
  6. package/lib/api/api.js +198 -44
  7. package/lib/api/shared.d.ts +30 -1
  8. package/lib/api/utils/constants.d.ts +1 -1
  9. package/lib/api/utils/constants.js +1 -1
  10. package/lib/api/utils/utils.d.ts +2 -1
  11. package/lib/api/utils/utils.js +1 -1
  12. package/lib/builders/Attachment.d.ts +1 -1
  13. package/lib/builders/Attachment.js +30 -8
  14. package/lib/builders/MediaGallery.d.ts +2 -2
  15. package/lib/builders/MediaGallery.js +10 -0
  16. package/lib/builders/Modal.d.ts +18 -8
  17. package/lib/builders/Modal.js +36 -7
  18. package/lib/builders/Poll.js +18 -0
  19. package/lib/builders/RadioGroup.d.ts +4 -3
  20. package/lib/builders/RadioGroup.js +24 -3
  21. package/lib/builders/SelectMenu.d.ts +8 -6
  22. package/lib/builders/SelectMenu.js +24 -3
  23. package/lib/builders/types.d.ts +3 -2
  24. package/lib/cache/adapters/default.d.ts +1 -1
  25. package/lib/cache/adapters/default.js +23 -26
  26. package/lib/cache/adapters/limited.d.ts +1 -0
  27. package/lib/cache/adapters/limited.js +47 -33
  28. package/lib/cache/index.d.ts +19 -25
  29. package/lib/cache/index.js +58 -6
  30. package/lib/cache/resources/bans.d.ts +1 -1
  31. package/lib/cache/resources/bans.js +4 -4
  32. package/lib/cache/resources/channels.d.ts +1 -1
  33. package/lib/cache/resources/channels.js +4 -4
  34. package/lib/cache/resources/default/base.d.ts +1 -1
  35. package/lib/cache/resources/default/base.js +8 -8
  36. package/lib/cache/resources/default/guild-based.d.ts +5 -5
  37. package/lib/cache/resources/default/guild-based.js +29 -16
  38. package/lib/cache/resources/default/guild-related.d.ts +5 -5
  39. package/lib/cache/resources/default/guild-related.js +14 -14
  40. package/lib/cache/resources/emojis.d.ts +1 -1
  41. package/lib/cache/resources/emojis.js +4 -4
  42. package/lib/cache/resources/guilds.js +28 -15
  43. package/lib/cache/resources/members.d.ts +1 -1
  44. package/lib/cache/resources/members.js +6 -6
  45. package/lib/cache/resources/messages.d.ts +7 -2
  46. package/lib/cache/resources/messages.js +43 -20
  47. package/lib/cache/resources/overwrites.d.ts +1 -1
  48. package/lib/cache/resources/overwrites.js +5 -8
  49. package/lib/cache/resources/roles.d.ts +1 -1
  50. package/lib/cache/resources/roles.js +4 -4
  51. package/lib/cache/resources/stickers.d.ts +1 -1
  52. package/lib/cache/resources/stickers.js +4 -4
  53. package/lib/cache/resources/users.js +4 -4
  54. package/lib/cache/resources/voice-states.d.ts +1 -1
  55. package/lib/cache/resources/voice-states.js +4 -4
  56. package/lib/client/base.d.ts +83 -24
  57. package/lib/client/base.js +594 -39
  58. package/lib/client/client.d.ts +29 -4
  59. package/lib/client/client.js +38 -13
  60. package/lib/client/collectors.d.ts +9 -8
  61. package/lib/client/collectors.js +19 -52
  62. package/lib/client/httpclient.d.ts +3 -0
  63. package/lib/client/index.d.ts +3 -1
  64. package/lib/client/index.js +4 -0
  65. package/lib/client/intents.d.ts +3 -0
  66. package/lib/client/intents.js +9 -0
  67. package/lib/client/plugins/api.d.ts +4 -0
  68. package/lib/client/plugins/api.js +550 -0
  69. package/lib/client/plugins/errors.d.ts +25 -0
  70. package/lib/client/plugins/errors.js +79 -0
  71. package/lib/client/plugins/order.d.ts +10 -0
  72. package/lib/client/plugins/order.js +32 -0
  73. package/lib/client/plugins/registry.d.ts +273 -0
  74. package/lib/client/plugins/registry.js +868 -0
  75. package/lib/client/plugins/shared.d.ts +23 -0
  76. package/lib/client/plugins/shared.js +193 -0
  77. package/lib/client/plugins/types.d.ts +398 -0
  78. package/lib/client/plugins/types.js +8 -0
  79. package/lib/client/plugins.d.ts +78 -0
  80. package/lib/client/plugins.js +558 -0
  81. package/lib/client/transformers.d.ts +33 -33
  82. package/lib/client/workerclient.d.ts +11 -2
  83. package/lib/client/workerclient.js +33 -22
  84. package/lib/collection.d.ts +10 -8
  85. package/lib/collection.js +19 -25
  86. package/lib/commands/applications/chat.d.ts +20 -18
  87. package/lib/commands/applications/chat.js +39 -14
  88. package/lib/commands/applications/chatcontext.d.ts +23 -15
  89. package/lib/commands/applications/chatcontext.js +23 -2
  90. package/lib/commands/applications/entryPoint.d.ts +4 -3
  91. package/lib/commands/applications/entryPoint.js +1 -1
  92. package/lib/commands/applications/entrycontext.d.ts +7 -9
  93. package/lib/commands/applications/entrycontext.js +3 -1
  94. package/lib/commands/applications/menu.d.ts +4 -3
  95. package/lib/commands/applications/menucontext.d.ts +7 -9
  96. package/lib/commands/applications/menucontext.js +3 -1
  97. package/lib/commands/applications/options.d.ts +23 -23
  98. package/lib/commands/applications/shared.d.ts +39 -17
  99. package/lib/commands/decorators.d.ts +50 -38
  100. package/lib/commands/decorators.js +15 -5
  101. package/lib/commands/handle.d.ts +19 -8
  102. package/lib/commands/handle.js +224 -143
  103. package/lib/commands/handler.d.ts +21 -8
  104. package/lib/commands/handler.js +157 -69
  105. package/lib/commands/index.d.ts +1 -0
  106. package/lib/commands/optionresolver.d.ts +2 -2
  107. package/lib/common/it/colors.js +12 -2
  108. package/lib/common/it/error.d.ts +9 -0
  109. package/lib/common/it/error.js +8 -0
  110. package/lib/common/it/fake-promise.d.ts +4 -0
  111. package/lib/common/it/fake-promise.js +10 -0
  112. package/lib/common/it/formatter.d.ts +14 -11
  113. package/lib/common/it/formatter.js +4 -3
  114. package/lib/common/it/logger.d.ts +7 -1
  115. package/lib/common/it/logger.js +24 -6
  116. package/lib/common/it/utils.d.ts +6 -8
  117. package/lib/common/it/utils.js +44 -42
  118. package/lib/common/shorters/application.d.ts +3 -3
  119. package/lib/common/shorters/application.js +3 -2
  120. package/lib/common/shorters/bans.d.ts +8 -4
  121. package/lib/common/shorters/bans.js +13 -5
  122. package/lib/common/shorters/channels.d.ts +4 -4
  123. package/lib/common/shorters/channels.js +4 -4
  124. package/lib/common/shorters/emojis.js +1 -0
  125. package/lib/common/shorters/guilds.d.ts +8 -8
  126. package/lib/common/shorters/guilds.js +14 -31
  127. package/lib/common/shorters/interaction.d.ts +1 -1
  128. package/lib/common/shorters/invites.d.ts +201 -201
  129. package/lib/common/shorters/members.d.ts +7 -7
  130. package/lib/common/shorters/members.js +13 -14
  131. package/lib/common/shorters/messages.d.ts +2 -2
  132. package/lib/common/shorters/soundboard.d.ts +5 -5
  133. package/lib/common/shorters/users.d.ts +1 -1
  134. package/lib/common/shorters/webhook.d.ts +3 -2
  135. package/lib/common/shorters/webhook.js +0 -7
  136. package/lib/common/types/options.d.ts +4 -0
  137. package/lib/common/types/util.d.ts +8 -0
  138. package/lib/common/types/write.d.ts +2 -1
  139. package/lib/components/BaseSelectMenuComponent.d.ts +1 -1
  140. package/lib/components/BaseSelectMenuComponent.js +1 -1
  141. package/lib/components/ButtonComponent.d.ts +3 -3
  142. package/lib/components/ChannelSelectMenuComponent.d.ts +2 -2
  143. package/lib/components/File.d.ts +1 -1
  144. package/lib/components/MediaGallery.d.ts +1 -1
  145. package/lib/components/MentionableSelectMenuComponent.d.ts +1 -1
  146. package/lib/components/RoleSelectMenuComponent.d.ts +1 -1
  147. package/lib/components/Separator.d.ts +1 -1
  148. package/lib/components/StringSelectMenuComponent.d.ts +1 -1
  149. package/lib/components/TextInputComponent.d.ts +1 -1
  150. package/lib/components/Thumbnail.d.ts +1 -1
  151. package/lib/components/UserSelectMenuComponent.d.ts +1 -1
  152. package/lib/components/componentcommand.d.ts +8 -7
  153. package/lib/components/componentcontext.d.ts +24 -36
  154. package/lib/components/componentcontext.js +7 -17
  155. package/lib/components/handler.d.ts +17 -7
  156. package/lib/components/handler.js +108 -49
  157. package/lib/components/index.d.ts +1 -0
  158. package/lib/components/index.js +1 -0
  159. package/lib/components/interactioncontext.d.ts +45 -0
  160. package/lib/components/interactioncontext.js +93 -0
  161. package/lib/components/modalcommand.d.ts +5 -4
  162. package/lib/components/modalcontext.d.ts +39 -20
  163. package/lib/components/modalcontext.js +59 -6
  164. package/lib/events/event.d.ts +9 -3
  165. package/lib/events/handler.d.ts +51 -6
  166. package/lib/events/handler.js +165 -36
  167. package/lib/events/hooks/application_command.d.ts +1 -1
  168. package/lib/events/hooks/auto_moderation.d.ts +2 -2
  169. package/lib/events/hooks/guild.d.ts +150 -150
  170. package/lib/events/hooks/interactions.d.ts +1 -1
  171. package/lib/events/hooks/invite.d.ts +20 -20
  172. package/lib/events/hooks/message.d.ts +27 -27
  173. package/lib/events/hooks/presence.d.ts +11 -11
  174. package/lib/events/hooks/soundboard.d.ts +6 -6
  175. package/lib/events/hooks/stage.d.ts +2 -2
  176. package/lib/events/hooks/subscriptions.d.ts +3 -3
  177. package/lib/events/hooks/thread.d.ts +30 -30
  178. package/lib/events/hooks/voice.d.ts +3 -4
  179. package/lib/events/hooks/voice.js +2 -1
  180. package/lib/events/utils.d.ts +4 -0
  181. package/lib/events/utils.js +59 -0
  182. package/lib/index.d.ts +9 -4
  183. package/lib/index.js +14 -8
  184. package/lib/langs/handler.d.ts +14 -11
  185. package/lib/langs/handler.js +46 -9
  186. package/lib/langs/router.d.ts +10 -3
  187. package/lib/structures/Application.d.ts +1 -1
  188. package/lib/structures/Emoji.d.ts +3 -3
  189. package/lib/structures/Emoji.js +2 -2
  190. package/lib/structures/Guild.d.ts +154 -154
  191. package/lib/structures/GuildBan.d.ts +4 -4
  192. package/lib/structures/GuildBan.js +3 -3
  193. package/lib/structures/GuildMember.d.ts +7 -7
  194. package/lib/structures/GuildMember.js +28 -7
  195. package/lib/structures/GuildRole.d.ts +1 -1
  196. package/lib/structures/GuildRole.js +2 -2
  197. package/lib/structures/Interaction.d.ts +11 -9
  198. package/lib/structures/Interaction.js +33 -12
  199. package/lib/structures/Message.d.ts +21 -14
  200. package/lib/structures/Message.js +29 -14
  201. package/lib/structures/User.d.ts +1 -1
  202. package/lib/structures/VoiceState.d.ts +4 -0
  203. package/lib/structures/VoiceState.js +13 -1
  204. package/lib/structures/Webhook.d.ts +9 -1
  205. package/lib/structures/Webhook.js +4 -1
  206. package/lib/structures/channels.d.ts +148 -134
  207. package/lib/structures/channels.js +27 -26
  208. package/lib/structures/extra/BitField.d.ts +4 -4
  209. package/lib/structures/extra/BitField.js +20 -4
  210. package/lib/structures/extra/DiscordBase.js +1 -1
  211. package/lib/structures/extra/Permissions.d.ts +2 -4
  212. package/lib/structures/extra/Permissions.js +1 -17
  213. package/lib/types/payloads/_interactions/responses.d.ts +2 -2
  214. package/lib/types/payloads/components.d.ts +4 -4
  215. package/lib/websocket/SharedTypes.d.ts +4 -4
  216. package/lib/websocket/constants/index.d.ts +1 -1
  217. package/lib/websocket/constants/index.js +3 -2
  218. package/lib/websocket/discord/events/memberUpdate.js +2 -2
  219. package/lib/websocket/discord/heartbeater.d.ts +1 -0
  220. package/lib/websocket/discord/heartbeater.js +7 -0
  221. package/lib/websocket/discord/shard.d.ts +2 -2
  222. package/lib/websocket/discord/shard.js +16 -14
  223. package/lib/websocket/discord/sharder.d.ts +8 -7
  224. package/lib/websocket/discord/sharder.js +26 -6
  225. package/lib/websocket/discord/shared.d.ts +19 -6
  226. package/lib/websocket/discord/socket/custom.js +5 -0
  227. package/lib/websocket/discord/worker.d.ts +1 -0
  228. package/lib/websocket/discord/worker.js +2 -0
  229. package/lib/websocket/discord/workermanager.d.ts +25 -11
  230. package/lib/websocket/discord/workermanager.js +41 -10
  231. package/package.json +13 -17
package/lib/index.js CHANGED
@@ -14,13 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.config = exports.WorkerManager = exports.ShardManager = exports.Logger = exports.Formatter = exports.LimitedCollection = exports.Collection = void 0;
17
+ exports.config = exports.WorkerManager = exports.ShardManager = exports.GuildRole = exports.TimestampStyle = exports.SeyfertErrorMessages = exports.SeyfertError = exports.LogLevels = exports.Logger = exports.HeadingLevel = exports.Formatter = exports.EmbedColors = exports.createValidationMetadata = exports.LimitedCollection = exports.Collection = void 0;
18
18
  exports.createEvent = createEvent;
19
19
  exports.extendContext = extendContext;
20
20
  __exportStar(require("./client"), exports);
21
21
  const base_1 = require("./client/base");
22
+ const intents_1 = require("./client/intents");
22
23
  const common_1 = require("./common");
23
- const types_1 = require("./types");
24
24
  //
25
25
  __exportStar(require("./api"), exports);
26
26
  __exportStar(require("./builders"), exports);
@@ -31,13 +31,23 @@ Object.defineProperty(exports, "Collection", { enumerable: true, get: function (
31
31
  Object.defineProperty(exports, "LimitedCollection", { enumerable: true, get: function () { return collection_1.LimitedCollection; } });
32
32
  __exportStar(require("./commands"), exports);
33
33
  var common_2 = require("./common");
34
+ Object.defineProperty(exports, "createValidationMetadata", { enumerable: true, get: function () { return common_2.createValidationMetadata; } });
35
+ Object.defineProperty(exports, "EmbedColors", { enumerable: true, get: function () { return common_2.EmbedColors; } });
34
36
  Object.defineProperty(exports, "Formatter", { enumerable: true, get: function () { return common_2.Formatter; } });
37
+ Object.defineProperty(exports, "HeadingLevel", { enumerable: true, get: function () { return common_2.HeadingLevel; } });
35
38
  Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return common_2.Logger; } });
39
+ Object.defineProperty(exports, "LogLevels", { enumerable: true, get: function () { return common_2.LogLevels; } });
40
+ Object.defineProperty(exports, "SeyfertError", { enumerable: true, get: function () { return common_2.SeyfertError; } });
41
+ Object.defineProperty(exports, "SeyfertErrorMessages", { enumerable: true, get: function () { return common_2.SeyfertErrorMessages; } });
42
+ Object.defineProperty(exports, "TimestampStyle", { enumerable: true, get: function () { return common_2.TimestampStyle; } });
36
43
  __exportStar(require("./components"), exports);
37
44
  __exportStar(require("./events"), exports);
38
45
  __exportStar(require("./langs"), exports);
39
46
  //
40
47
  __exportStar(require("./structures"), exports);
48
+ var GuildRole_1 = require("./structures/GuildRole");
49
+ Object.defineProperty(exports, "GuildRole", { enumerable: true, get: function () { return GuildRole_1.GuildRole; } });
50
+ __exportStar(require("./types"), exports);
41
51
  //
42
52
  var discord_1 = require("./websocket/discord");
43
53
  Object.defineProperty(exports, "ShardManager", { enumerable: true, get: function () { return discord_1.ShardManager; } });
@@ -70,11 +80,7 @@ exports.config = {
70
80
  bot(data) {
71
81
  return {
72
82
  ...data,
73
- intents: 'intents' in data
74
- ? typeof data.intents === 'number'
75
- ? data.intents
76
- : (data.intents?.reduce((pr, acc) => pr | (typeof acc === 'number' ? acc : types_1.GatewayIntentBits[acc]), 0) ?? 0)
77
- : 0,
83
+ intents: (0, intents_1.resolveGatewayIntents)(data.intents),
78
84
  };
79
85
  },
80
86
  /**
@@ -88,7 +94,7 @@ exports.config = {
88
94
  port: 8080,
89
95
  ...data,
90
96
  };
91
- if ((0, common_1.isCloudfareWorker)())
97
+ if ((0, common_1.isCloudflareWorker)())
92
98
  base_1.BaseClient._seyfertCfWorkerConfig = obj;
93
99
  return obj;
94
100
  },
@@ -1,29 +1,32 @@
1
1
  import type { FileLoaded } from '../commands/handler';
2
- import { BaseHandler } from '../common';
2
+ import { type Awaitable, BaseHandler } from '../common';
3
3
  import type { LocaleString } from '../types';
4
+ type LangFileResult = {
5
+ file: Record<string, any>;
6
+ locale: string;
7
+ } | false;
4
8
  export declare class LangsHandler extends BaseHandler {
5
9
  values: Partial<Record<string, any>>;
6
10
  private __paths;
7
11
  filter: (path: string) => boolean;
8
12
  defaultLang?: string;
13
+ preferGuildLocale: boolean;
9
14
  aliases: [string, LocaleString[]][];
15
+ onReload?: (locale: string, value: Record<string, any>) => void;
10
16
  getLocale(locale: string): string;
11
17
  getKey(lang: string, message: string): string | undefined;
12
- get(userLocale: string): import("./router").__InternalParseLocale<import("..").DefaultLocale> & {
13
- get(locale?: string): import("..").DefaultLocale;
14
- };
18
+ get(userLocale: string): import("./router").SeyfertLocale;
15
19
  load(dir: string): Promise<void>;
16
- parse(file: LangInstance): void;
20
+ parse(file: LangInstance): void | Promise<void>;
21
+ private applyParsedFile;
17
22
  set(instances: LangInstance[]): void;
18
- reload(lang: string): Promise<Record<string, any> | null>;
23
+ reload(lang: string): Promise<any>;
19
24
  reloadAll(stopIfFail?: boolean): Promise<void>;
20
- onFile(locale: string, { file }: LangInstance): {
21
- file: Record<string, any>;
22
- locale: string;
23
- } | false;
25
+ onFile(locale: string, { file, name, path }: LangInstance): Awaitable<LangFileResult>;
24
26
  }
25
27
  export type LangInstance = {
26
28
  name: string;
27
29
  file: FileLoaded<Record<string, any>>;
28
- path: string;
30
+ path?: string;
29
31
  };
32
+ export {};
@@ -4,12 +4,17 @@ exports.LangsHandler = void 0;
4
4
  const node_path_1 = require("node:path");
5
5
  const common_1 = require("../common");
6
6
  const router_1 = require("./router");
7
+ function isPromiseLike(value) {
8
+ return !!value && typeof value.then === 'function';
9
+ }
7
10
  class LangsHandler extends common_1.BaseHandler {
8
11
  values = {};
9
12
  __paths = {};
10
13
  filter = (path) => path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts')) || path.endsWith('.json');
11
14
  defaultLang;
15
+ preferGuildLocale = false;
12
16
  aliases = [];
17
+ onReload;
13
18
  getLocale(locale) {
14
19
  return this.aliases.find(([_key, aliases]) => aliases.includes(locale))?.[0] ?? locale;
15
20
  }
@@ -35,15 +40,21 @@ class LangsHandler extends common_1.BaseHandler {
35
40
  async load(dir) {
36
41
  const files = await this.loadFilesK(await this.getFiles(dir));
37
42
  for (const i of files) {
38
- this.parse(i);
43
+ await this.parse(i);
39
44
  }
40
45
  }
41
46
  parse(file) {
42
47
  const oldLocale = file.name.split('.').slice(0, -1).join('.') || file.name;
43
48
  const result = this.onFile(oldLocale, file);
49
+ if (isPromiseLike(result))
50
+ return result.then(value => this.applyParsedFile(file, value));
51
+ this.applyParsedFile(file, result);
52
+ return;
53
+ }
54
+ applyParsedFile(file, result) {
44
55
  if (!result)
45
56
  return;
46
- if ('path' in file)
57
+ if (file.path)
47
58
  this.__paths[result.locale] = file.path;
48
59
  this.values[result.locale] = result.file;
49
60
  }
@@ -53,7 +64,7 @@ class LangsHandler extends common_1.BaseHandler {
53
64
  }
54
65
  }
55
66
  async reload(lang) {
56
- if ((0, common_1.isCloudfareWorker)()) {
67
+ if ((0, common_1.isCloudflareWorker)()) {
57
68
  throw new common_1.SeyfertError('RELOAD_NOT_SUPPORTED', {
58
69
  metadata: { detail: 'Reload in Cloudflare worker is not supported' },
59
70
  });
@@ -69,7 +80,9 @@ class LangsHandler extends common_1.BaseHandler {
69
80
  }));
70
81
  if (!value)
71
82
  return null;
72
- return (this.values[lang] = value.file);
83
+ this.values[lang] = value.file;
84
+ this.onReload?.(lang, value.file);
85
+ return this.values[lang];
73
86
  }
74
87
  async reloadAll(stopIfFail = true) {
75
88
  for (const i in this.__paths) {
@@ -82,13 +95,37 @@ class LangsHandler extends common_1.BaseHandler {
82
95
  }
83
96
  }
84
97
  }
85
- onFile(locale, { file }) {
86
- return file.default
87
- ? {
98
+ onFile(locale, { file, name, path }) {
99
+ const modulePath = path ?? name;
100
+ if ((0, common_1.isObject)(file.default)) {
101
+ return {
88
102
  file: file.default,
89
103
  locale,
90
- }
91
- : false;
104
+ };
105
+ }
106
+ if (!(0, common_1.isObject)(file)) {
107
+ this.logger.warn(`Lang file "${modulePath}" skipped: invalid module value.`, `exports: ${typeof file}`);
108
+ return false;
109
+ }
110
+ const module = file;
111
+ const isModuleNamespace = module[Symbol.toStringTag] === 'Module' || 'default' in file || '__esModule' in file;
112
+ if (!isModuleNamespace) {
113
+ return { file, locale };
114
+ }
115
+ const exportNames = Object.keys(file).filter(key => key !== 'default' && key !== '__esModule');
116
+ const objectExportNames = exportNames.filter(key => (0, common_1.isObject)(file[key]));
117
+ if (objectExportNames.length === 1 && !('default' in file)) {
118
+ const exportName = objectExportNames[0];
119
+ this.logger.warn(`Lang file "${modulePath}" has no default export; using named object export "${exportName}".`, `exports: ${exportNames.join(', ') || '(none)'}`);
120
+ return {
121
+ file: file[exportName],
122
+ locale,
123
+ };
124
+ }
125
+ const invalidDefault = 'default' in file ? 'default' : undefined;
126
+ const invalidExports = [invalidDefault, ...exportNames].filter((key) => !!key);
127
+ this.logger.warn(`Lang file "${modulePath}" skipped: ${objectExportNames.length > 1 ? 'ambiguous named object exports' : 'no valid default export'}.`, `exports: ${invalidExports.join(', ') || '(none)'}`);
128
+ return false;
92
129
  }
93
130
  }
94
131
  exports.LangsHandler = LangsHandler;
@@ -1,7 +1,5 @@
1
1
  import type { DefaultLocale } from '../commands';
2
- export declare const LangRouter: (userLocale: string, defaultLang: string, langs: Partial<Record<string, any>>) => (route?: string[], args?: any[]) => __InternalParseLocale<DefaultLocale> & {
3
- get(locale?: string): DefaultLocale;
4
- };
2
+ export declare const LangRouter: (userLocale: string, defaultLang: string, langs: Partial<Record<string, any>>) => (route?: string[], args?: any[]) => SeyfertLocale;
5
3
  export type __InternalParseLocale<T extends Record<string, any>> = {
6
4
  [K in keyof T]: T[K] extends (...args: any[]) => any ? (...args: Parameters<T[K]>) => {
7
5
  get(locale?: string): ReturnType<T[K]>;
@@ -13,5 +11,14 @@ export type __InternalParseLocale<T extends Record<string, any>> = {
13
11
  get(locale?: string): T[K];
14
12
  } : never;
15
13
  };
14
+ /**
15
+ * The `ctx.t` / `client.t(...)` accessor type. Kept as a named alias so that inferred return
16
+ * types (BaseClient.t, the context `t` getters, ...) emit a reference to `DefaultLocale` instead
17
+ * of eagerly baking it to `{}` at build time (where `SeyfertRegistry` has no `langs`), which left
18
+ * consumers with an untyped `ctx.t`.
19
+ */
20
+ export type SeyfertLocale = __InternalParseLocale<DefaultLocale> & {
21
+ get(locale?: string): DefaultLocale;
22
+ };
16
23
  export type ParseLocales<T extends Record<string, any>> = T;
17
24
  /**Idea inspiration from: FreeAoi | Fixed by: Drylozu */
@@ -21,7 +21,7 @@ export declare class Application extends DiscordBase<APIApplication> {
21
21
  /**
22
22
  * Get an activity instance.
23
23
  */
24
- getActivityInstance(instanceId: string): Promise<import("../types").RestGetAPIApplicationActivityInstanceResult>;
24
+ getActivityInstance(instanceId: string): Promise<import("..").RestGetAPIApplicationActivityInstanceResult>;
25
25
  emojis: {
26
26
  /**
27
27
  * Get an application emoji.
@@ -1,6 +1,6 @@
1
1
  import type { BaseCDNUrlOptions } from '../api';
2
2
  import type { ReturnCache } from '../cache';
3
- import { type ApplicationEmojiStructure, type GuildEmojiStructure, type GuildStructure, type UserStructure } from '../client';
3
+ import { type ApplicationEmojiStructure, type GuildEmojiStructure, type GuildStructure, type UserStructure } from '../client/transformers';
4
4
  import type { UsingClient } from '../commands';
5
5
  import { type EmojiShorter, type MethodContext, type ObjectToLower, type When } from '../common';
6
6
  import type { APIApplicationEmoji, APIEmoji, RESTPatchAPIApplicationEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody } from '../types';
@@ -11,7 +11,7 @@ export declare class Emoji<T extends boolean = false> extends DiscordBase {
11
11
  user: When<T, UserStructure>;
12
12
  constructor(client: UsingClient, data: APIEmoji);
13
13
  url(options?: BaseCDNUrlOptions): string;
14
- toString(): string;
14
+ toString(): `<:${string}:${string}>` | `<a:${string}:${string}>`;
15
15
  toJSON(): {
16
16
  id: string;
17
17
  name: string | null;
@@ -41,5 +41,5 @@ export declare class ApplicationEmoji extends Emoji<true> {
41
41
  constructor(client: UsingClient, data: APIApplicationEmoji);
42
42
  fetch(): Promise<ApplicationEmojiStructure>;
43
43
  edit(body: RESTPatchAPIApplicationEmojiJSONBody): Promise<ApplicationEmojiStructure>;
44
- delete(): Promise<undefined>;
44
+ delete(): Promise<void>;
45
45
  }
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApplicationEmoji = exports.GuildEmoji = exports.Emoji = void 0;
4
- const client_1 = require("../client");
4
+ const transformers_1 = require("../client/transformers");
5
5
  const common_1 = require("../common");
6
6
  const DiscordBase_1 = require("./extra/DiscordBase");
7
7
  class Emoji extends DiscordBase_1.DiscordBase {
8
8
  user;
9
9
  constructor(client, data) {
10
10
  super(client, { ...data, id: data.id });
11
- this.user = (data.user && client_1.Transformers.User(client, data.user));
11
+ this.user = (data.user && transformers_1.Transformers.User(client, data.user));
12
12
  }
13
13
  url(options) {
14
14
  return this.rest.cdn.emojis(this.id).get(options);