seyfert 1.0.0 → 1.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 (112) hide show
  1. package/lib/api/CDN.d.ts +1 -1
  2. package/lib/api/CDN.js +0 -2
  3. package/lib/api/Router.js +2 -2
  4. package/lib/api/Routes/applications.d.ts +29 -33
  5. package/lib/api/Routes/channels.d.ts +11 -17
  6. package/lib/api/Routes/interactions.d.ts +3 -7
  7. package/lib/api/Routes/webhooks.d.ts +4 -6
  8. package/lib/api/api.d.ts +5 -0
  9. package/lib/api/api.js +36 -0
  10. package/lib/api/shared.d.ts +5 -3
  11. package/lib/builders/Attachment.d.ts +2 -3
  12. package/lib/builders/Button.d.ts +2 -2
  13. package/lib/cache/adapters/default.d.ts +1 -0
  14. package/lib/cache/adapters/default.js +1 -0
  15. package/lib/cache/adapters/redis.d.ts +1 -0
  16. package/lib/cache/adapters/redis.js +7 -0
  17. package/lib/cache/adapters/types.d.ts +1 -0
  18. package/lib/cache/adapters/workeradapter.d.ts +5 -4
  19. package/lib/cache/adapters/workeradapter.js +11 -5
  20. package/lib/cache/index.d.ts +4 -6
  21. package/lib/cache/index.js +5 -6
  22. package/lib/cache/resources/default/base.d.ts +2 -1
  23. package/lib/cache/resources/default/guild-based.d.ts +2 -1
  24. package/lib/cache/resources/default/guild-based.js +6 -6
  25. package/lib/cache/resources/default/guild-related.d.ts +2 -1
  26. package/lib/cache/resources/default/guild-related.js +1 -1
  27. package/lib/cache/resources/guilds.js +2 -1
  28. package/lib/cache/resources/overwrites.d.ts +1 -1
  29. package/lib/cache/resources/overwrites.js +7 -1
  30. package/lib/client/base.d.ts +18 -171
  31. package/lib/client/base.js +12 -15
  32. package/lib/client/client.d.ts +6 -1
  33. package/lib/client/client.js +13 -12
  34. package/lib/client/oninteractioncreate.js +4 -4
  35. package/lib/client/onmessagecreate.js +188 -152
  36. package/lib/client/workerclient.d.ts +15 -1
  37. package/lib/client/workerclient.js +135 -27
  38. package/lib/collection.js +2 -2
  39. package/lib/commands/applications/chat.d.ts +15 -7
  40. package/lib/commands/applications/chat.js +7 -7
  41. package/lib/commands/applications/chatcontext.d.ts +6 -4
  42. package/lib/commands/applications/chatcontext.js +12 -7
  43. package/lib/commands/applications/menu.d.ts +5 -1
  44. package/lib/commands/applications/menu.js +4 -0
  45. package/lib/commands/applications/menucontext.d.ts +5 -3
  46. package/lib/commands/applications/menucontext.js +9 -4
  47. package/lib/commands/applications/options.d.ts +1 -2
  48. package/lib/commands/decorators.d.ts +17 -5
  49. package/lib/commands/decorators.js +17 -7
  50. package/lib/commands/handler.d.ts +5 -5
  51. package/lib/commands/handler.js +40 -36
  52. package/lib/commands/optionresolver.d.ts +11 -4
  53. package/lib/commands/optionresolver.js +6 -4
  54. package/lib/common/index.d.ts +7 -0
  55. package/lib/common/index.js +7 -0
  56. package/lib/common/it/utils.js +2 -0
  57. package/lib/common/shorters/channels.d.ts +67 -129
  58. package/lib/common/shorters/channels.js +119 -135
  59. package/lib/common/shorters/emojis.d.ts +47 -0
  60. package/lib/common/shorters/emojis.js +80 -0
  61. package/lib/common/shorters/guilds.d.ts +22 -249
  62. package/lib/common/shorters/guilds.js +51 -140
  63. package/lib/common/shorters/members.d.ts +82 -108
  64. package/lib/common/shorters/members.js +151 -166
  65. package/lib/common/shorters/messages.d.ts +11 -23
  66. package/lib/common/shorters/messages.js +58 -104
  67. package/lib/common/shorters/reactions.d.ts +10 -0
  68. package/lib/common/shorters/reactions.js +45 -0
  69. package/lib/common/shorters/roles.d.ts +39 -7
  70. package/lib/common/shorters/roles.js +74 -42
  71. package/lib/common/shorters/templates.d.ts +6 -8
  72. package/lib/common/shorters/templates.js +17 -21
  73. package/lib/common/shorters/users.d.ts +4 -0
  74. package/lib/common/shorters/users.js +30 -0
  75. package/lib/common/shorters/webhook.d.ts +62 -26
  76. package/lib/common/shorters/webhook.js +113 -58
  77. package/lib/common/types/options.d.ts +2 -2
  78. package/lib/common/types/util.d.ts +1 -1
  79. package/lib/components/handler.d.ts +11 -8
  80. package/lib/components/handler.js +34 -22
  81. package/lib/index.d.ts +4 -2
  82. package/lib/langs/handler.js +7 -2
  83. package/lib/structures/AutoModerationRule.d.ts +2 -2
  84. package/lib/structures/ClientUser.d.ts +2 -2
  85. package/lib/structures/Guild.d.ts +2 -2
  86. package/lib/structures/GuildEmoji.d.ts +4 -4
  87. package/lib/structures/GuildEmoji.js +7 -7
  88. package/lib/structures/GuildMember.d.ts +6 -6
  89. package/lib/structures/GuildMember.js +2 -2
  90. package/lib/structures/GuildPreview.d.ts +2 -2
  91. package/lib/structures/GuildRole.d.ts +2 -2
  92. package/lib/structures/GuildTemplate.d.ts +2 -2
  93. package/lib/structures/Interaction.d.ts +7 -8
  94. package/lib/structures/Interaction.js +1 -1
  95. package/lib/structures/Message.d.ts +7 -6
  96. package/lib/structures/Message.js +7 -4
  97. package/lib/structures/Sticker.d.ts +2 -2
  98. package/lib/structures/Webhook.d.ts +2 -2
  99. package/lib/structures/Webhook.js +3 -3
  100. package/lib/structures/channels.d.ts +19 -20
  101. package/lib/structures/channels.js +13 -25
  102. package/lib/structures/extra/Base.d.ts +1 -2
  103. package/lib/structures/extra/DiscordBase.d.ts +2 -2
  104. package/lib/websocket/constants/index.js +2 -3
  105. package/lib/websocket/discord/shard.js +4 -2
  106. package/lib/websocket/discord/sharder.d.ts +3 -0
  107. package/lib/websocket/discord/sharder.js +12 -5
  108. package/lib/websocket/discord/shared.d.ts +3 -0
  109. package/lib/websocket/discord/worker.d.ts +24 -7
  110. package/lib/websocket/discord/workermanager.d.ts +30 -6
  111. package/lib/websocket/discord/workermanager.js +160 -51
  112. package/package.json +8 -5
@@ -3,22 +3,33 @@ import type { CommandOption, OptionsRecord, SubCommand } from './applications/ch
3
3
  import type { DefaultLocale, MiddlewareContext } from './applications/shared';
4
4
  export interface RegisteredMiddlewares {
5
5
  }
6
+ export declare enum IntegrationTypes {
7
+ GUILD_INSTALL = 0,
8
+ USER_INSTALL = 1
9
+ }
10
+ export declare enum InteractionContextTypes {
11
+ GUILD = 0,
12
+ BOT_DM = 1,
13
+ PRIVATE_CHANNEL = 2
14
+ }
6
15
  type DeclareOptions = {
7
16
  name: string;
8
17
  description: string;
9
18
  botPermissions?: PermissionStrings | bigint;
10
- defaultPermissions?: PermissionStrings | bigint;
19
+ defaultMemberPermissions?: PermissionStrings | bigint;
11
20
  guildId?: string[];
12
- dm?: boolean;
13
21
  nsfw?: boolean;
22
+ integrationTypes?: (keyof typeof IntegrationTypes)[];
23
+ contexts?: (keyof typeof InteractionContextTypes)[];
14
24
  } | (Omit<{
15
25
  name: string;
16
26
  description: string;
17
27
  botPermissions?: PermissionStrings | bigint;
18
- defaultPermissions?: PermissionStrings | bigint;
28
+ defaultMemberPermissions?: PermissionStrings | bigint;
19
29
  guildId?: string[];
20
- dm?: boolean;
21
30
  nsfw?: boolean;
31
+ integrationTypes?: (keyof typeof IntegrationTypes)[];
32
+ contexts?: (keyof typeof InteractionContextTypes)[];
22
33
  }, 'type' | 'description'> & {
23
34
  type: ApplicationCommandType.User | ApplicationCommandType.Message;
24
35
  });
@@ -96,9 +107,10 @@ export declare function Declare(declare: DeclareOptions): <T extends new (...arg
96
107
  new (...args: any[]): {
97
108
  name: string;
98
109
  nsfw: boolean | undefined;
110
+ contexts: InteractionContextTypes[] | undefined;
111
+ integration_types: IntegrationTypes[] | undefined;
99
112
  default_member_permissions: string | bigint | undefined;
100
113
  botPermissions: bigint | undefined;
101
- dm?: boolean | undefined;
102
114
  description: string;
103
115
  type: ApplicationCommandType;
104
116
  guild_id?: string[] | undefined;
@@ -1,7 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Declare = exports.Middlewares = exports.AutoLoad = exports.Options = exports.Group = exports.Groups = exports.GroupsT = exports.LocalesT = exports.Locales = void 0;
3
+ exports.Declare = exports.Middlewares = exports.AutoLoad = exports.Options = exports.Group = exports.Groups = exports.GroupsT = exports.LocalesT = exports.Locales = exports.InteractionContextTypes = exports.IntegrationTypes = void 0;
4
4
  const common_1 = require("../common");
5
+ var IntegrationTypes;
6
+ (function (IntegrationTypes) {
7
+ IntegrationTypes[IntegrationTypes["GUILD_INSTALL"] = 0] = "GUILD_INSTALL";
8
+ IntegrationTypes[IntegrationTypes["USER_INSTALL"] = 1] = "USER_INSTALL";
9
+ })(IntegrationTypes || (exports.IntegrationTypes = IntegrationTypes = {}));
10
+ var InteractionContextTypes;
11
+ (function (InteractionContextTypes) {
12
+ InteractionContextTypes[InteractionContextTypes["GUILD"] = 0] = "GUILD";
13
+ InteractionContextTypes[InteractionContextTypes["BOT_DM"] = 1] = "BOT_DM";
14
+ InteractionContextTypes[InteractionContextTypes["PRIVATE_CHANNEL"] = 2] = "PRIVATE_CHANNEL";
15
+ })(InteractionContextTypes || (exports.InteractionContextTypes = InteractionContextTypes = {}));
5
16
  function Locales({ name: names, description: descriptions, }) {
6
17
  return (target) => class extends target {
7
18
  name_localizations = names ? Object.fromEntries(names) : undefined;
@@ -62,13 +73,14 @@ function Declare(declare) {
62
73
  return (target) => class extends target {
63
74
  name = declare.name;
64
75
  nsfw = declare.nsfw;
65
- default_member_permissions = Array.isArray(declare.defaultPermissions)
66
- ? declare.defaultPermissions?.reduce((acc, prev) => acc | common_1.PermissionFlagsBits[prev], BigInt(0)).toString()
67
- : declare.defaultPermissions;
76
+ contexts = declare.contexts?.map(i => InteractionContextTypes[i]);
77
+ integration_types = declare.integrationTypes?.map(i => IntegrationTypes[i]);
78
+ default_member_permissions = Array.isArray(declare.defaultMemberPermissions)
79
+ ? declare.defaultMemberPermissions?.reduce((acc, prev) => acc | common_1.PermissionFlagsBits[prev], BigInt(0)).toString()
80
+ : declare.defaultMemberPermissions;
68
81
  botPermissions = Array.isArray(declare.botPermissions)
69
82
  ? declare.botPermissions?.reduce((acc, prev) => acc | common_1.PermissionFlagsBits[prev], BigInt(0))
70
83
  : declare.botPermissions;
71
- dm;
72
84
  description = '';
73
85
  type = common_1.ApplicationCommandType.ChatInput;
74
86
  guild_id;
@@ -78,8 +90,6 @@ function Declare(declare) {
78
90
  this.description = declare.description;
79
91
  if ('type' in declare)
80
92
  this.type = declare.type;
81
- if ('dm' in declare)
82
- this.dm = !!declare.dm;
83
93
  if ('guildId' in declare)
84
94
  this.guild_id = declare.guildId;
85
95
  // check if all properties are valid
@@ -1,16 +1,16 @@
1
- import type { BaseClient } from '../client/base';
2
1
  import type { Logger } from '../common';
3
2
  import { BaseHandler } from '../common';
4
3
  import { Command } from './applications/chat';
5
4
  import { ContextMenuCommand } from './applications/menu';
5
+ import type { UsingClient } from './applications/shared';
6
6
  export declare class CommandHandler extends BaseHandler {
7
7
  protected logger: Logger;
8
- protected client: BaseClient;
8
+ protected client: UsingClient;
9
9
  values: (Command | ContextMenuCommand)[];
10
10
  protected filter: (path: string) => boolean;
11
- constructor(logger: Logger, client: BaseClient);
11
+ constructor(logger: Logger, client: UsingClient);
12
12
  reload(resolve: string | Command): Promise<void>;
13
13
  reloadAll(stopIfFail?: boolean): Promise<void>;
14
- load(commandsDir: string, client: BaseClient): Promise<(Command | ContextMenuCommand)[]>;
15
- private __parseLocales;
14
+ load(commandsDir: string, client: UsingClient): Promise<(Command | ContextMenuCommand)[]>;
15
+ private __parseCommandLocales;
16
16
  }
@@ -63,6 +63,7 @@ class CommandHandler extends common_1.BaseHandler {
63
63
  commandInstance.__filePath = command.path;
64
64
  commandInstance.options ??= [];
65
65
  if (commandInstance.__d) {
66
+ //@AutoLoad
66
67
  const options = await this.getFiles((0, node_path_1.dirname)(command.path));
67
68
  for (const option of options) {
68
69
  if (command.name === (0, node_path_1.basename)(option)) {
@@ -95,45 +96,60 @@ class CommandHandler extends common_1.BaseHandler {
95
96
  }
96
97
  }
97
98
  this.values.push(commandInstance);
98
- this.__parseLocales(commandInstance, client);
99
+ this.__parseCommandLocales(commandInstance, client);
99
100
  for (const i of commandInstance.options ?? []) {
100
101
  if (i instanceof chat_1.SubCommand) {
101
- this.__parseLocales(i, client);
102
+ this.__parseCommandLocales(i, client);
102
103
  }
103
104
  }
104
105
  }
105
106
  return this.values;
106
107
  }
107
- __parseLocales(command, client) {
108
+ __parseCommandLocales(command, client) {
108
109
  if (command.__t) {
109
110
  command.name_localizations = {};
110
111
  command.description_localizations = {};
111
112
  for (const locale of Object.keys(client.langs.values)) {
112
- const aliases = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
113
- if (Object.values(common_1.Locale).includes(locale)) {
114
- if (command.__t.name) {
113
+ const locales = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
114
+ if (Object.values(common_1.Locale).includes(locale))
115
+ locales.push(locale);
116
+ if (command.__t.name) {
117
+ for (const i of locales) {
115
118
  const valueName = client.langs.getKey(locale, command.__t.name);
116
119
  if (valueName)
117
- command.name_localizations[locale] = valueName;
120
+ command.name_localizations[i] = valueName;
118
121
  }
119
- if (command.__t.description) {
122
+ }
123
+ if (command.__t.description) {
124
+ for (const i of locales) {
120
125
  const valueKey = client.langs.getKey(locale, command.__t.description);
121
126
  if (valueKey)
122
- command.description_localizations[locale] = valueKey;
127
+ command.description_localizations[i] = valueKey;
123
128
  }
124
129
  }
125
- for (const i of aliases) {
126
- if (command.__t.name) {
127
- const valueName = client.langs.getKey(locale, command.__t.name);
130
+ }
131
+ }
132
+ for (const options of command.options ?? []) {
133
+ if (options instanceof chat_1.SubCommand || !options.locales)
134
+ continue;
135
+ options.name_localizations = {};
136
+ options.description_localizations = {};
137
+ for (const locale of Object.keys(client.langs.values)) {
138
+ const locales = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
139
+ if (Object.values(common_1.Locale).includes(locale))
140
+ locales.push(locale);
141
+ if (options.locales.name) {
142
+ for (const i of locales) {
143
+ const valueName = client.langs.getKey(locale, options.locales.name);
128
144
  if (valueName)
129
- command.name_localizations[i] = valueName;
145
+ options.name_localizations[i] = valueName;
130
146
  }
131
147
  }
132
- for (const i of aliases) {
133
- if (command.__t.description) {
134
- const valueKey = client.langs.getKey(locale, command.__t.description);
148
+ if (options.locales.description) {
149
+ for (const i of locales) {
150
+ const valueKey = client.langs.getKey(locale, options.locales.description);
135
151
  if (valueKey)
136
- command.description_localizations[i] = valueKey;
152
+ options.description_localizations[i] = valueKey;
137
153
  }
138
154
  }
139
155
  }
@@ -141,37 +157,25 @@ class CommandHandler extends common_1.BaseHandler {
141
157
  if (command instanceof chat_1.Command && command.__tGroups) {
142
158
  command.groups = {};
143
159
  for (const locale of Object.keys(client.langs.values)) {
144
- const aliases = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
160
+ const locales = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
161
+ if (Object.values(common_1.Locale).includes(locale))
162
+ locales.push(locale);
145
163
  for (const group in command.__tGroups) {
146
164
  command.groups[group] ??= {
147
165
  defaultDescription: command.__tGroups[group].defaultDescription,
148
166
  description: [],
149
167
  name: [],
150
168
  };
151
- if (Object.values(common_1.Locale).includes(locale)) {
152
- if (command.__tGroups[group].name) {
153
- const valueName = client.langs.getKey(locale, command.__tGroups[group].name);
154
- if (valueName) {
155
- command.groups[group].name.push([locale, valueName]);
156
- }
157
- }
158
- if (command.__tGroups[group].description) {
159
- const valueKey = client.langs.getKey(locale, command.__tGroups[group].description);
160
- if (valueKey) {
161
- command.groups[group].description.push([locale, valueKey]);
162
- }
163
- }
164
- }
165
- for (const i of aliases) {
166
- if (command.__tGroups[group].name) {
169
+ if (command.__tGroups[group].name) {
170
+ for (const i of locales) {
167
171
  const valueName = client.langs.getKey(locale, command.__tGroups[group].name);
168
172
  if (valueName) {
169
173
  command.groups[group].name.push([i, valueName]);
170
174
  }
171
175
  }
172
176
  }
173
- for (const i of aliases) {
174
- if (command.__tGroups[group].description) {
177
+ if (command.__tGroups[group].description) {
178
+ for (const i of locales) {
175
179
  const valueKey = client.langs.getKey(locale, command.__tGroups[group].description);
176
180
  if (valueKey) {
177
181
  command.groups[group].description.push([i, valueKey]);
@@ -1,20 +1,27 @@
1
1
  import { Attachment, GuildMember } from '..';
2
- import type { APIApplicationCommandInteractionDataOption, APIInteractionDataResolved, MakeRequired } from '../common';
2
+ import type { APIApplicationCommandInteractionDataOption, APIAttachment, APIGuildMember, APIInteractionDataResolvedChannel, APIInteractionGuildMember, APIRole, APIUser, MakeRequired } from '../common';
3
3
  import { ApplicationCommandOptionType } from '../common';
4
4
  import type { AllChannels } from '../structures';
5
5
  import { GuildRole, InteractionGuildMember, User } from '../structures';
6
6
  import type { Command, CommandAutocompleteOption, SubCommand } from './applications/chat';
7
7
  import type { UsingClient } from './applications/shared';
8
+ export type ContextOptionsResolved = {
9
+ members?: Record<string, APIGuildMember | APIInteractionGuildMember | GuildMember | InteractionGuildMember>;
10
+ users?: Record<string, APIUser | User>;
11
+ roles?: Record<string, APIRole | GuildRole>;
12
+ channels?: Record<string, APIInteractionDataResolvedChannel | AllChannels>;
13
+ attachments?: Record<string, APIAttachment | Attachment>;
14
+ };
8
15
  export declare class OptionResolver {
9
16
  private client;
10
17
  parent?: Command | undefined;
11
18
  guildId?: string | undefined;
12
- resolved?: APIInteractionDataResolved | undefined;
19
+ resolved?: ContextOptionsResolved | undefined;
13
20
  readonly options: OptionResolved[];
14
21
  hoistedOptions: OptionResolved[];
15
22
  private subCommand;
16
23
  private group;
17
- constructor(client: UsingClient, options: APIApplicationCommandInteractionDataOption[], parent?: Command | undefined, guildId?: string | undefined, resolved?: APIInteractionDataResolved | undefined);
24
+ constructor(client: UsingClient, options: APIApplicationCommandInteractionDataOption[], parent?: Command | undefined, guildId?: string | undefined, resolved?: ContextOptionsResolved | undefined);
18
25
  get fullCommandName(): string;
19
26
  getCommand(): Command | SubCommand | undefined;
20
27
  getAutocompleteValue(): string | undefined;
@@ -28,7 +35,7 @@ export declare class OptionResolver {
28
35
  private getTypedOption;
29
36
  getChannel(name: string, required?: true): AllChannels;
30
37
  getString(name: string, required?: true): string;
31
- transformOption(option: APIApplicationCommandInteractionDataOption, resolved?: APIInteractionDataResolved): OptionResolved;
38
+ transformOption(option: APIApplicationCommandInteractionDataOption, resolved?: ContextOptionsResolved): OptionResolved;
32
39
  }
33
40
  export interface OptionResolved {
34
41
  name: string;
@@ -122,14 +122,16 @@ class OptionResolver {
122
122
  const value = resolve.value;
123
123
  const user = resolved.users?.[value];
124
124
  if (user) {
125
- resolve.user = new structures_1.User(this.client, user);
125
+ resolve.user = user instanceof structures_1.User ? user : new structures_1.User(this.client, user);
126
126
  }
127
127
  const member = resolved.members?.[value];
128
128
  if (member) {
129
129
  resolve.member =
130
- member instanceof __1.GuildMember
130
+ member instanceof __1.GuildMember || member instanceof structures_1.InteractionGuildMember
131
131
  ? member
132
- : new structures_1.InteractionGuildMember(this.client, member, user, this.guildId);
132
+ : 'permissions' in member
133
+ ? new structures_1.InteractionGuildMember(this.client, member, user, this.guildId)
134
+ : new __1.GuildMember(this.client, member, user, this.guildId);
133
135
  }
134
136
  const channel = resolved.channels?.[value];
135
137
  if (channel) {
@@ -141,7 +143,7 @@ class OptionResolver {
141
143
  }
142
144
  const attachment = resolved.attachments?.[value];
143
145
  if (attachment) {
144
- resolve.attachment = new __1.Attachment(this.client, attachment);
146
+ resolve.attachment = attachment instanceof __1.Attachment ? attachment : new __1.Attachment(this.client, attachment);
145
147
  }
146
148
  }
147
149
  return resolve;
@@ -4,8 +4,15 @@ export * from 'discord-api-types/v10';
4
4
  export * from './it/colors';
5
5
  export * from './it/logger';
6
6
  export * from './shorters/channels';
7
+ export * from './shorters/emojis';
7
8
  export * from './shorters/guilds';
9
+ export * from './shorters/members';
10
+ export * from './shorters/messages';
11
+ export * from './shorters/reactions';
12
+ export * from './shorters/roles';
13
+ export * from './shorters/templates';
8
14
  export * from './shorters/users';
15
+ export * from './shorters/webhook';
9
16
  export * from './types/options';
10
17
  export * from './types/resolvables';
11
18
  export * from './types/util';
@@ -21,8 +21,15 @@ __exportStar(require("discord-api-types/v10"), exports);
21
21
  __exportStar(require("./it/colors"), exports);
22
22
  __exportStar(require("./it/logger"), exports);
23
23
  __exportStar(require("./shorters/channels"), exports);
24
+ __exportStar(require("./shorters/emojis"), exports);
24
25
  __exportStar(require("./shorters/guilds"), exports);
26
+ __exportStar(require("./shorters/members"), exports);
27
+ __exportStar(require("./shorters/messages"), exports);
28
+ __exportStar(require("./shorters/reactions"), exports);
29
+ __exportStar(require("./shorters/roles"), exports);
30
+ __exportStar(require("./shorters/templates"), exports);
25
31
  __exportStar(require("./shorters/users"), exports);
32
+ __exportStar(require("./shorters/webhook"), exports);
26
33
  __exportStar(require("./types/options"), exports);
27
34
  __exportStar(require("./types/resolvables"), exports);
28
35
  __exportStar(require("./types/util"), exports);
@@ -240,6 +240,7 @@ async function magicImport(path) {
240
240
  return require(path);
241
241
  }
242
242
  catch {
243
+ // biome-ignore lint/security/noGlobalEval: modules import broke
243
244
  return eval('((path) => import(`file:///${path}`))')(path.split('\\').join('\\\\'));
244
245
  }
245
246
  }
@@ -248,6 +249,7 @@ function fakePromise(value) {
248
249
  if (value instanceof Promise)
249
250
  return value;
250
251
  return {
252
+ // biome-ignore lint/suspicious/noThenProperty: magic
251
253
  then: callback => callback(value),
252
254
  };
253
255
  }
@@ -4,135 +4,73 @@ import { type AllChannels } from '../../structures/channels';
4
4
  import { PermissionsBitField } from '../../structures/extra/Permissions';
5
5
  import { BaseShorter } from './base';
6
6
  export declare class ChannelShorter extends BaseShorter {
7
- get channels(): {
8
- /**
9
- * Fetches a channel by its ID.
10
- * @param id The ID of the channel to fetch.
11
- * @param force Whether to force fetching the channel from the API even if it exists in the cache.
12
- * @returns A Promise that resolves to the fetched channel.
13
- */
14
- fetch: (id: string, force?: boolean) => Promise<AllChannels>;
15
- /**
16
- * Deletes a channel by its ID.
17
- * @param id The ID of the channel to delete.
18
- * @param optional Optional parameters for the deletion.
19
- * @returns A Promise that resolves to the deleted channel.
20
- */
21
- delete: (id: string, optional?: ChannelShorterOptionalParams) => Promise<AllChannels>;
22
- /**
23
- * Edits a channel by its ID.
24
- * @param id The ID of the channel to edit.
25
- * @param body The updated channel data.
26
- * @param optional Optional parameters for the editing.
27
- * @returns A Promise that resolves to the edited channel.
28
- */
29
- edit: (id: string, body: RESTPatchAPIChannelJSONBody, optional?: ChannelShorterOptionalParams) => Promise<AllChannels>;
30
- /**
31
- * Sends a typing indicator to the channel.
32
- * @param id The ID of the channel.
33
- * @returns A Promise that resolves when the typing indicator is successfully sent.
34
- */
35
- typing: (id: string) => Promise<never>;
36
- /**
37
- * Provides access to pinned messages in the channel.
38
- */
39
- pins: {
40
- /**
41
- * Fetches pinned messages in the channel.
42
- * @param channelId The ID of the channel.
43
- * @returns A Promise that resolves to an array of pinned messages.
44
- */
45
- fetch: (channelId: string) => Promise<Message[]>;
46
- /**
47
- * Pins a message in the channel.
48
- * @param messageId The ID of the message to pin.
49
- * @param channelId The ID of the channel.
50
- * @param reason The reason for pinning the message.
51
- * @returns A Promise that resolves when the message is successfully pinned.
52
- */
53
- set: (messageId: string, channelId: string, reason?: string | undefined) => Promise<never>;
54
- /**
55
- * Unpins a message in the channel.
56
- * @param messageId The ID of the message to unpin.
57
- * @param channelId The ID of the channel.
58
- * @param reason The reason for unpinning the message.
59
- * @returns A Promise that resolves when the message is successfully unpinned.
60
- */
61
- delete: (messageId: string, channelId: string, reason?: string | undefined) => Promise<never>;
62
- };
63
- overwrites: {
64
- memberPermissions: (channelId: string, member: GuildMember, checkAdmin?: boolean) => Promise<PermissionsBitField>;
65
- overwritesFor: (channelId: string, member: GuildMember) => Promise<{
66
- everyone: {
67
- type: number;
68
- id: string;
69
- deny: PermissionsBitField;
70
- allow: PermissionsBitField;
71
- } | undefined;
72
- roles: {
73
- type: number;
74
- id: string;
75
- deny: PermissionsBitField;
76
- allow: PermissionsBitField;
77
- }[];
78
- member: {
79
- type: number;
80
- id: string;
81
- deny: PermissionsBitField;
82
- allow: PermissionsBitField;
83
- } | undefined;
84
- }>;
85
- rolePermissions: (channelId: string, role: GuildRole, checkAdmin?: boolean) => Promise<PermissionsBitField>;
86
- };
87
- };
88
- get pins(): {
89
- /**
90
- * Fetches pinned messages in the channel.
91
- * @param channelId The ID of the channel.
92
- * @returns A Promise that resolves to an array of pinned messages.
93
- */
94
- fetch: (channelId: string) => Promise<Message[]>;
95
- /**
96
- * Pins a message in the channel.
97
- * @param messageId The ID of the message to pin.
98
- * @param channelId The ID of the channel.
99
- * @param reason The reason for pinning the message.
100
- * @returns A Promise that resolves when the message is successfully pinned.
101
- */
102
- set: (messageId: string, channelId: string, reason?: string) => Promise<never>;
103
- /**
104
- * Unpins a message in the channel.
105
- * @param messageId The ID of the message to unpin.
106
- * @param channelId The ID of the channel.
107
- * @param reason The reason for unpinning the message.
108
- * @returns A Promise that resolves when the message is successfully unpinned.
109
- */
110
- delete: (messageId: string, channelId: string, reason?: string) => Promise<never>;
111
- };
112
- get overwrites(): {
113
- memberPermissions: (channelId: string, member: GuildMember, checkAdmin?: boolean) => Promise<PermissionsBitField>;
114
- overwritesFor: (channelId: string, member: GuildMember) => Promise<{
115
- everyone: {
116
- type: number;
117
- id: string;
118
- deny: PermissionsBitField;
119
- allow: PermissionsBitField;
120
- } | undefined;
121
- roles: {
122
- type: number;
123
- id: string;
124
- deny: PermissionsBitField;
125
- allow: PermissionsBitField;
126
- }[];
127
- member: {
128
- type: number;
129
- id: string;
130
- deny: PermissionsBitField;
131
- allow: PermissionsBitField;
132
- } | undefined;
133
- }>;
134
- rolePermissions: (channelId: string, role: GuildRole, checkAdmin?: boolean) => Promise<PermissionsBitField>;
135
- };
7
+ /**
8
+ * Fetches a channel by its ID.
9
+ * @param id The ID of the channel to fetch.
10
+ * @param force Whether to force fetching the channel from the API even if it exists in the cache.
11
+ * @returns A Promise that resolves to the fetched channel.
12
+ */
13
+ fetch(id: string, force?: boolean): Promise<AllChannels>;
14
+ /**
15
+ * Deletes a channel by its ID.
16
+ * @param id The ID of the channel to delete.
17
+ * @param optional Optional parameters for the deletion.
18
+ * @returns A Promise that resolves to the deleted channel.
19
+ */
20
+ delete(id: string, optional?: ChannelShorterOptionalParams): Promise<AllChannels>;
21
+ /**
22
+ * Edits a channel by its ID.
23
+ * @param id The ID of the channel to edit.
24
+ * @param body The updated channel data.
25
+ * @param optional Optional parameters for the editing.
26
+ * @returns A Promise that resolves to the edited channel.
27
+ */
28
+ edit(id: string, body: RESTPatchAPIChannelJSONBody, optional?: ChannelShorterOptionalParams): Promise<AllChannels>;
29
+ /**
30
+ * Sends a typing indicator to the channel.
31
+ * @param id The ID of the channel.
32
+ * @returns A Promise that resolves when the typing indicator is successfully sent.
33
+ */
34
+ typing(id: string): Promise<void>;
35
+ pins(channelId: string): Promise<Message[]>;
36
+ /**
37
+ * Pins a message in the channel.
38
+ * @param messageId The ID of the message to pin.
39
+ * @param channelId The ID of the channel.
40
+ * @param reason The reason for pinning the message.
41
+ * @returns A Promise that resolves when the message is successfully pinned.
42
+ */
43
+ setPin(messageId: string, channelId: string, reason?: string): Promise<never>;
44
+ /**
45
+ * Unpins a message in the channel.
46
+ * @param messageId The ID of the message to unpin.
47
+ * @param channelId The ID of the channel.
48
+ * @param reason The reason for unpinning the message.
49
+ * @returns A Promise that resolves when the message is successfully unpinned.
50
+ */
51
+ deletePin(messageId: string, channelId: string, reason?: string): Promise<never>;
52
+ memberPermissions(channelId: string, member: GuildMember, checkAdmin?: boolean): Promise<PermissionsBitField>;
53
+ overwritesFor(channelId: string, member: GuildMember): Promise<{
54
+ everyone: {
55
+ type: number;
56
+ id: string;
57
+ deny: PermissionsBitField;
58
+ allow: PermissionsBitField;
59
+ } | undefined;
60
+ roles: {
61
+ type: number;
62
+ id: string;
63
+ deny: PermissionsBitField;
64
+ allow: PermissionsBitField;
65
+ }[];
66
+ member: {
67
+ type: number;
68
+ id: string;
69
+ deny: PermissionsBitField;
70
+ allow: PermissionsBitField;
71
+ } | undefined;
72
+ }>;
73
+ rolePermissions(channelId: string, role: GuildRole, checkAdmin?: boolean): Promise<PermissionsBitField>;
136
74
  }
137
75
  export type ChannelShorterOptionalParams = Partial<{
138
76
  guildId: string;