seyfert 1.0.1 → 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 (103) 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/builders/Attachment.d.ts +2 -3
  9. package/lib/cache/adapters/redis.js +6 -0
  10. package/lib/cache/adapters/workeradapter.d.ts +4 -4
  11. package/lib/cache/adapters/workeradapter.js +10 -5
  12. package/lib/cache/index.d.ts +4 -5
  13. package/lib/cache/index.js +4 -3
  14. package/lib/cache/resources/default/base.d.ts +2 -1
  15. package/lib/cache/resources/default/guild-based.d.ts +2 -1
  16. package/lib/cache/resources/default/guild-based.js +6 -6
  17. package/lib/cache/resources/default/guild-related.d.ts +2 -1
  18. package/lib/cache/resources/default/guild-related.js +1 -1
  19. package/lib/cache/resources/guilds.js +2 -1
  20. package/lib/cache/resources/overwrites.d.ts +1 -1
  21. package/lib/cache/resources/overwrites.js +7 -1
  22. package/lib/client/base.d.ts +18 -170
  23. package/lib/client/base.js +11 -14
  24. package/lib/client/client.d.ts +5 -0
  25. package/lib/client/client.js +4 -1
  26. package/lib/client/oninteractioncreate.js +2 -2
  27. package/lib/client/onmessagecreate.js +188 -152
  28. package/lib/client/workerclient.d.ts +1 -0
  29. package/lib/client/workerclient.js +36 -15
  30. package/lib/collection.js +2 -2
  31. package/lib/commands/applications/chat.d.ts +15 -7
  32. package/lib/commands/applications/chat.js +7 -7
  33. package/lib/commands/applications/chatcontext.d.ts +5 -3
  34. package/lib/commands/applications/chatcontext.js +6 -1
  35. package/lib/commands/applications/menu.d.ts +5 -1
  36. package/lib/commands/applications/menu.js +4 -0
  37. package/lib/commands/applications/menucontext.d.ts +4 -2
  38. package/lib/commands/applications/menucontext.js +6 -1
  39. package/lib/commands/applications/options.d.ts +1 -2
  40. package/lib/commands/decorators.d.ts +17 -5
  41. package/lib/commands/decorators.js +17 -7
  42. package/lib/commands/handler.d.ts +5 -5
  43. package/lib/commands/handler.js +40 -36
  44. package/lib/commands/optionresolver.d.ts +11 -4
  45. package/lib/commands/optionresolver.js +6 -4
  46. package/lib/common/index.d.ts +7 -0
  47. package/lib/common/index.js +7 -0
  48. package/lib/common/it/utils.js +2 -0
  49. package/lib/common/shorters/channels.d.ts +67 -129
  50. package/lib/common/shorters/channels.js +119 -135
  51. package/lib/common/shorters/emojis.d.ts +47 -0
  52. package/lib/common/shorters/emojis.js +80 -0
  53. package/lib/common/shorters/guilds.d.ts +22 -249
  54. package/lib/common/shorters/guilds.js +51 -140
  55. package/lib/common/shorters/members.d.ts +82 -108
  56. package/lib/common/shorters/members.js +151 -166
  57. package/lib/common/shorters/messages.d.ts +11 -23
  58. package/lib/common/shorters/messages.js +58 -104
  59. package/lib/common/shorters/reactions.d.ts +10 -0
  60. package/lib/common/shorters/reactions.js +45 -0
  61. package/lib/common/shorters/roles.d.ts +39 -7
  62. package/lib/common/shorters/roles.js +74 -42
  63. package/lib/common/shorters/templates.d.ts +6 -8
  64. package/lib/common/shorters/templates.js +17 -21
  65. package/lib/common/shorters/users.d.ts +4 -0
  66. package/lib/common/shorters/users.js +30 -0
  67. package/lib/common/shorters/webhook.d.ts +62 -26
  68. package/lib/common/shorters/webhook.js +113 -58
  69. package/lib/common/types/options.d.ts +2 -2
  70. package/lib/components/handler.d.ts +10 -7
  71. package/lib/components/handler.js +20 -5
  72. package/lib/index.d.ts +4 -2
  73. package/lib/langs/handler.js +7 -2
  74. package/lib/structures/AutoModerationRule.d.ts +2 -2
  75. package/lib/structures/ClientUser.d.ts +2 -2
  76. package/lib/structures/Guild.d.ts +2 -2
  77. package/lib/structures/GuildEmoji.d.ts +4 -4
  78. package/lib/structures/GuildEmoji.js +7 -7
  79. package/lib/structures/GuildMember.d.ts +6 -6
  80. package/lib/structures/GuildMember.js +2 -2
  81. package/lib/structures/GuildPreview.d.ts +2 -2
  82. package/lib/structures/GuildRole.d.ts +2 -2
  83. package/lib/structures/GuildTemplate.d.ts +2 -2
  84. package/lib/structures/Interaction.d.ts +7 -8
  85. package/lib/structures/Interaction.js +1 -1
  86. package/lib/structures/Message.d.ts +7 -6
  87. package/lib/structures/Message.js +7 -4
  88. package/lib/structures/Sticker.d.ts +2 -2
  89. package/lib/structures/Webhook.d.ts +2 -2
  90. package/lib/structures/Webhook.js +3 -3
  91. package/lib/structures/channels.d.ts +19 -20
  92. package/lib/structures/channels.js +13 -25
  93. package/lib/structures/extra/Base.d.ts +1 -2
  94. package/lib/structures/extra/DiscordBase.d.ts +2 -2
  95. package/lib/websocket/constants/index.js +1 -0
  96. package/lib/websocket/discord/shard.js +4 -2
  97. package/lib/websocket/discord/sharder.d.ts +3 -0
  98. package/lib/websocket/discord/sharder.js +12 -5
  99. package/lib/websocket/discord/shared.d.ts +1 -0
  100. package/lib/websocket/discord/worker.d.ts +2 -1
  101. package/lib/websocket/discord/workermanager.d.ts +8 -3
  102. package/lib/websocket/discord/workermanager.js +78 -30
  103. package/package.json +8 -6
@@ -2,178 +2,26 @@ import { ApiHandler } from '../api';
2
2
  import type { Adapter } from '../cache';
3
3
  import { Cache } from '../cache';
4
4
  import type { RegisteredMiddlewares } from '../commands';
5
- import type { MiddlewareContext } from '../commands/applications/shared';
5
+ import type { InferWithPrefix, MiddlewareContext } from '../commands/applications/shared';
6
6
  import { CommandHandler } from '../commands/handler';
7
- import { Logger, type LocaleString, type MakeRequired } from '../common';
8
- import type { DeepPartial, IntentStrings, OmitInsert } from '../common/types/util';
7
+ import { ChannelShorter, EmojiShorter, GuildShorter, Logger, MemberShorter, MessageShorter, ReactionShorter, RoleShorter, TemplateShorter, UsersShorter, WebhookShorter, type LocaleString, type MakeRequired } from '../common';
8
+ import type { DeepPartial, IntentStrings, OmitInsert, When } from '../common/types/util';
9
9
  import { ComponentHandler } from '../components/handler';
10
10
  import { LangsHandler } from '../langs/handler';
11
- import type { ChatInputCommandInteraction, MessageCommandInteraction, UserCommandInteraction } from '../structures';
11
+ import type { ChatInputCommandInteraction, Message, MessageCommandInteraction, UserCommandInteraction } from '../structures';
12
12
  export declare class BaseClient {
13
13
  rest: ApiHandler;
14
14
  cache: Cache;
15
- users: {
16
- createDM: (userId: string, force?: boolean) => Promise<import("../structures").DMChannel>;
17
- deleteDM: (userId: string, reason?: string | undefined) => Promise<import("../structures").DMChannel>;
18
- fetch: (userId: string, force?: boolean) => Promise<import("../structures").User>;
19
- write: (userId: string, body: Omit<import("discord-api-types/rest/v10/channel").RESTPostAPIChannelMessageJSONBody, "components" | "embeds"> & import("../common").ResolverProps) => Promise<import("../structures").Message>;
20
- };
21
- channels: {
22
- fetch: (id: string, force?: boolean | undefined) => Promise<import("../structures").AllChannels>;
23
- delete: (id: string, optional?: Partial<{
24
- guildId: string;
25
- reason: string;
26
- }>) => Promise<import("../structures").AllChannels>;
27
- edit: (id: string, body: import("discord-api-types/rest/v10/channel").RESTPatchAPIChannelJSONBody, optional?: Partial<{
28
- guildId: string;
29
- reason: string;
30
- }>) => Promise<import("../structures").AllChannels>;
31
- typing: (id: string) => Promise<never>;
32
- pins: {
33
- fetch: (channelId: string) => Promise<import("../structures").Message[]>;
34
- set: (messageId: string, channelId: string, reason?: string | undefined) => Promise<never>;
35
- delete: (messageId: string, channelId: string, reason?: string | undefined) => Promise<never>;
36
- };
37
- overwrites: {
38
- memberPermissions: (channelId: string, member: import("../structures").GuildMember, checkAdmin?: boolean) => Promise<import("../structures/extra/Permissions").PermissionsBitField>;
39
- overwritesFor: (channelId: string, member: import("../structures").GuildMember) => Promise<{
40
- everyone: {
41
- type: number;
42
- id: string;
43
- deny: import("../structures/extra/Permissions").PermissionsBitField;
44
- allow: import("../structures/extra/Permissions").PermissionsBitField;
45
- } | undefined;
46
- roles: {
47
- type: number;
48
- id: string;
49
- deny: import("../structures/extra/Permissions").PermissionsBitField;
50
- allow: import("../structures/extra/Permissions").PermissionsBitField;
51
- }[];
52
- member: {
53
- type: number;
54
- id: string;
55
- deny: import("../structures/extra/Permissions").PermissionsBitField;
56
- allow: import("../structures/extra/Permissions").PermissionsBitField;
57
- } | undefined;
58
- }>;
59
- rolePermissions: (channelId: string, role: import("../structures").GuildRole, checkAdmin?: boolean) => Promise<import("../structures/extra/Permissions").PermissionsBitField>;
60
- };
61
- };
62
- guilds: {
63
- create: (body: import("discord-api-types/rest/v10/guild").RESTPostAPIGuildsJSONBody) => Promise<import("../structures").Guild<"api">>;
64
- fetch: (id: string, force?: boolean) => Promise<import("../structures").Guild<"cached"> | import("../structures").Guild<"api">>;
65
- widgetURL: (id: string, style?: import("discord-api-types/payloads/v10/guild").GuildWidgetStyle | undefined) => Promise<import("discord-api-types/payloads/v10/guild").APIGuildWidgetSettings>;
66
- list: (query?: import("discord-api-types/rest/v10/user").RESTGetAPICurrentUserGuildsQuery | undefined) => Promise<import("../structures").AnonymousGuild[]>;
67
- fetchSelf: (id: string) => Promise<import("../structures").GuildMember>;
68
- leave: (id: string) => Promise<void | undefined>;
69
- channels: {
70
- list: (guildId: string, force?: boolean) => Promise<import("../structures").AllChannels[]>;
71
- fetch: (guildId: string, channelId: string, force?: boolean | undefined) => Promise<import("../structures").AllChannels>;
72
- create: (guildId: string, body: import("discord-api-types/rest/v10/guild").RESTPostAPIGuildChannelJSONBody) => Promise<import("../structures").AllChannels>;
73
- delete: (guildId: string, channelId: string, reason?: string | undefined) => Promise<import("../structures").AllChannels>;
74
- edit: (guildchannelId: string, channelId: string, body: import("discord-api-types/rest/v10/channel").RESTPatchAPIChannelJSONBody, reason?: string | undefined) => Promise<import("../structures").AllChannels>;
75
- editPositions: (guildId: string, body: import("discord-api-types/rest/v10/guild").RESTPatchAPIGuildChannelPositionsJSONBody) => Promise<never>;
76
- };
77
- moderation: {
78
- list: (guildId: string) => Promise<import("discord-api-types/rest/v10/autoModeration").RESTGetAPIAutoModerationRulesResult>;
79
- create: (guildId: string, body: import("discord-api-types/rest/v10/autoModeration").RESTPostAPIAutoModerationRuleJSONBody) => Promise<import("discord-api-types/payloads/v10/autoModeration").APIAutoModerationRule>;
80
- delete: (guildId: string, ruleId: string, reason?: string | undefined) => Promise<never>;
81
- fetch: (guildId: string, ruleId: string) => Promise<import("discord-api-types/payloads/v10/autoModeration").APIAutoModerationRule>;
82
- edit: (guildId: string, ruleId: string, body: {
83
- name?: string | undefined;
84
- eventType?: import("discord-api-types/payloads/v10/autoModeration").AutoModerationRuleEventType | undefined;
85
- triggerMetadata?: import("discord-api-types/payloads/v10/autoModeration").APIAutoModerationRuleTriggerMetadata | undefined;
86
- actions?: import("discord-api-types/payloads/v10/autoModeration").APIAutoModerationAction[] | undefined;
87
- enabled?: boolean | undefined;
88
- exemptRoles?: string[] | undefined;
89
- exemptChannels?: string[] | undefined;
90
- }, reason?: string | undefined) => Promise<import("discord-api-types/payloads/v10/autoModeration").APIAutoModerationRule>;
91
- };
92
- stickers: {
93
- list: (guildId: string) => Promise<import("../structures").Sticker[]>;
94
- create: (guildId: string, { file, ...json }: import("../structures").CreateStickerBodyRequest, reason?: string | undefined) => Promise<import("../structures").Sticker>;
95
- edit: (guildId: string, stickerId: string, body: import("discord-api-types/rest/v10/sticker").RESTPatchAPIGuildStickerJSONBody, reason?: string | undefined) => Promise<import("../structures").Sticker>;
96
- fetch: (guildId: string, stickerId: string, force?: boolean) => Promise<import("../structures").Sticker>;
97
- delete: (guildId: string, stickerId: string, reason?: string | undefined) => Promise<void>;
98
- };
99
- emojis: {
100
- list: (guildId: string, force?: boolean) => Promise<import("../structures").GuildEmoji[]>;
101
- create: (guildId: string, body: Omit<import("discord-api-types/rest/v10/emoji").RESTPostAPIGuildEmojiJSONBody, "image"> & {
102
- image: import("../common").ImageResolvable;
103
- }) => Promise<void>;
104
- fetch: (guildId: string, emojiId: string, force?: boolean) => Promise<import("../structures").GuildEmoji>;
105
- delete: (guildId: string, emojiId: string, reason?: string | undefined) => Promise<void>;
106
- edit: (guildId: string, emojiId: string, body: import("discord-api-types/rest/v10/emoji").RESTPatchAPIGuildEmojiJSONBody, reason?: string | undefined) => Promise<import("../structures").GuildEmoji>;
107
- };
108
- };
109
- messages: {
110
- write: (channelId: string, { files, ...body }: Omit<import("discord-api-types/rest/v10/channel").RESTPostAPIChannelMessageJSONBody, "components" | "embeds"> & import("../common").ResolverProps) => Promise<import("../structures").Message>;
111
- edit: (messageId: string, channelId: string, { files, ...body }: Omit<import("discord-api-types/rest/v10/channel").RESTPatchAPIChannelMessageJSONBody, "components" | "embeds"> & import("../common").ResolverProps) => Promise<import("../structures").Message>;
112
- crosspost: (messageId: string, channelId: string, reason?: string | undefined) => Promise<import("../structures").Message>;
113
- delete: (messageId: string, channelId: string, reason?: string | undefined) => Promise<void>;
114
- fetch: (messageId: string, channelId: string) => Promise<import("../structures").Message>;
115
- purge: (messages: string[], channelId: string, reason?: string | undefined) => Promise<never>;
116
- reactions: {
117
- add: (messageId: string, channelId: string, emoji: import("../common").EmojiResolvable) => Promise<never>;
118
- delete: (messageId: string, channelId: string, emoji: import("../common").EmojiResolvable, userId?: string) => Promise<never>;
119
- fetch: (messageId: string, channelId: string, emoji: import("../common").EmojiResolvable, query?: import("discord-api-types/rest/v10/channel").RESTGetAPIChannelMessageReactionUsersQuery | undefined) => Promise<import("../structures").User[]>;
120
- purge: (messageId: string, channelId: string, emoji?: import("../common").EmojiResolvable | undefined) => Promise<never>;
121
- };
122
- };
123
- members: {
124
- resolve: (guildId: string, resolve: import("../common").GuildMemberResolvable) => Promise<import("../structures").GuildMember | undefined>;
125
- search: (guildId: string, query?: import("discord-api-types/rest/v10/guild").RESTGetAPIGuildMembersSearchQuery | undefined) => Promise<import("../structures").GuildMember[]>;
126
- unban: (guildId: string, memberId: string, body?: import("discord-api-types/rest/v10/guild").RESTPutAPIGuildBanJSONBody | undefined, reason?: string | undefined) => Promise<void>;
127
- ban: (guildId: string, memberId: string, body?: import("discord-api-types/rest/v10/guild").RESTPutAPIGuildBanJSONBody | undefined, reason?: string | undefined) => Promise<void>;
128
- kick: (guildId: string, memberId: string, reason?: string | undefined) => Promise<void>;
129
- edit: (guildId: string, memberId: string, body: import("discord-api-types/rest/v10/guild").RESTPatchAPIGuildMemberJSONBody, reason?: string | undefined) => Promise<import("../structures").GuildMember>;
130
- add: (guildId: string, memberId: string, body: import("discord-api-types/rest/v10/guild").RESTPutAPIGuildMemberJSONBody) => Promise<import("../structures").GuildMember | undefined>;
131
- fetch: (guildId: string, memberId: string, force?: boolean) => Promise<import("../structures").GuildMember>;
132
- list: (guildId: string, query?: import("discord-api-types/rest/v10/guild").RESTGetAPIGuildMembersQuery | undefined, force?: boolean) => Promise<import("../structures").GuildMember[]>;
133
- roles: {
134
- add: (guildId: string, memberId: string, id: string) => Promise<void>;
135
- remove: (guildId: string, memberId: string, id: string) => Promise<void>;
136
- };
137
- };
138
- webhooks: {
139
- delete: (webhookId: string, { token, reason }: Partial<{
140
- token: string;
141
- reason: string;
142
- }>) => Promise<never>;
143
- edit: (webhookId: string, body: import("discord-api-types/rest/v10/webhook").RESTPatchAPIWebhookJSONBody | import("discord-api-types/rest/v10/webhook").RESTPatchAPIWebhookWithTokenJSONBody, { token, reason }: Partial<{
144
- token: string;
145
- reason: string;
146
- }>) => Promise<import("discord-api-types/rest/v10/webhook").RESTGetAPIWebhookWithTokenResult>;
147
- fetch: (webhookId: string, token?: string | undefined) => Promise<import("../structures").Webhook>;
148
- messages: {
149
- write: (webhookId: string, token: string, { body: data, ...payload }: {
150
- body: Omit<import("discord-api-types/rest/v10/webhook").RESTPostAPIWebhookWithTokenJSONBody, "components" | "embeds"> & import("../common").ResolverProps;
151
- query?: import("discord-api-types/rest/v10/webhook").RESTPostAPIWebhookWithTokenQuery | undefined;
152
- }) => Promise<import("../structures").WebhookMessage | null>;
153
- edit: (webhookId: string, token: string, { messageId, body: data, ...json }: {
154
- body: Omit<import("discord-api-types/rest/v10/webhook").RESTPatchAPIWebhookWithTokenMessageJSONBody, "components" | "embeds"> & import("../common").ResolverProps;
155
- messageId: string;
156
- query?: import("discord-api-types/rest/v10/webhook").RESTGetAPIWebhookWithTokenMessageQuery | undefined;
157
- }) => Promise<import("../structures").WebhookMessage>;
158
- delete: (webhookId: string, token: string, messageId: string, reason?: string | undefined) => Promise<never>;
159
- fetch: (webhookId: string, token: string, messageId: string, threadId?: string | undefined) => Promise<import("../structures").WebhookMessage | undefined>;
160
- };
161
- };
162
- templates: {
163
- fetch: (code: string) => Promise<import("discord-api-types/payloads/v10/template").APITemplate>;
164
- list: (guildId: string) => Promise<import("discord-api-types/rest/v10/template").RESTGetAPIGuildTemplatesResult>;
165
- create: (guildId: string, body: import("discord-api-types/rest/v10/template").RESTPostAPIGuildTemplatesJSONBody) => Promise<import("discord-api-types/payloads/v10/template").APITemplate>;
166
- sync: (guildId: string, code: string) => Promise<import("discord-api-types/payloads/v10/template").APITemplate>;
167
- edit: (guildId: string, code: string, body: import("discord-api-types/utils/internals").AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Partial<import("discord-api-types/rest/v10/template").RESTPostAPIGuildTemplatesJSONBody>>) => Promise<import("discord-api-types/payloads/v10/template").APITemplate>;
168
- delete: (guildId: string, code: string) => Promise<import("discord-api-types/payloads/v10/template").APITemplate>;
169
- };
170
- roles: {
171
- create: (guildId: string, body: import("discord-api-types/rest/v10/guild").RESTPostAPIGuildRoleJSONBody, reason?: string | undefined) => Promise<any>;
172
- list: (guildId: string, force?: boolean) => Promise<import("../structures").GuildRole[]>;
173
- edit: (guildId: string, roleId: string, body: import("discord-api-types/rest/v10/guild").RESTPatchAPIGuildRoleJSONBody, reason?: string | undefined) => Promise<any>;
174
- delete: (guildId: string, roleId: string, reason?: string | undefined) => Promise<void | undefined>;
175
- editPositions: (guildId: string, body: import("discord-api-types/rest/v10/guild").RESTPatchAPIGuildRolePositionsJSONBody) => Promise<import("../structures").GuildRole[]>;
176
- };
15
+ users: UsersShorter;
16
+ channels: ChannelShorter;
17
+ guilds: GuildShorter;
18
+ messages: MessageShorter;
19
+ members: MemberShorter;
20
+ webhooks: WebhookShorter;
21
+ templates: TemplateShorter;
22
+ roles: RoleShorter;
23
+ reactions: ReactionShorter;
24
+ emojis: EmojiShorter;
177
25
  debugger?: Logger;
178
26
  logger: Logger;
179
27
  langs: LangsHandler;
@@ -215,7 +63,7 @@ export declare class BaseClient {
215
63
  }>;
216
64
  }
217
65
  export interface BaseClientOptions {
218
- context?: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean>) => {};
66
+ context?: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | When<InferWithPrefix, Message, never>) => {};
219
67
  globalMiddlewares?: readonly (keyof RegisteredMiddlewares)[];
220
68
  }
221
69
  export interface StartOptions {
@@ -261,10 +109,10 @@ export type InternalRuntimeConfig = Omit<MakeRequired<RC, 'intents'>, 'publicKey
261
109
  export type RuntimeConfig = OmitInsert<InternalRuntimeConfig, 'intents', {
262
110
  intents?: IntentStrings | number;
263
111
  }>;
264
- export type ServicesOptions = {
112
+ export interface ServicesOptions {
265
113
  rest?: ApiHandler;
266
114
  cache?: {
267
- adapter: Adapter;
115
+ adapter?: Adapter;
268
116
  disabledCache?: Cache['disabledCache'];
269
117
  };
270
118
  langs?: {
@@ -272,5 +120,5 @@ export type ServicesOptions = {
272
120
  aliases?: Record<string, LocaleString[]>;
273
121
  };
274
122
  middlewares?: Record<string, MiddlewareContext>;
275
- };
123
+ }
276
124
  export {};
@@ -6,24 +6,21 @@ const api_1 = require("../api");
6
6
  const cache_1 = require("../cache");
7
7
  const handler_1 = require("../commands/handler");
8
8
  const common_1 = require("../common");
9
- const members_1 = require("../common/shorters/members");
10
- const messages_1 = require("../common/shorters/messages");
11
- const roles_1 = require("../common/shorters/roles");
12
- const templates_1 = require("../common/shorters/templates");
13
- const webhook_1 = require("../common/shorters/webhook");
14
9
  const handler_2 = require("../components/handler");
15
10
  const handler_3 = require("../langs/handler");
16
11
  class BaseClient {
17
12
  rest;
18
13
  cache;
19
- users = new common_1.UsersShorter(this).users;
20
- channels = new common_1.ChannelShorter(this).channels;
21
- guilds = new common_1.GuildShorter(this).guilds;
22
- messages = new messages_1.MessageShorter(this).messages;
23
- members = new members_1.MemberShorter(this).members;
24
- webhooks = new webhook_1.WebhookShorter(this).webhooks;
25
- templates = new templates_1.TemplateShorter(this).templates;
26
- roles = new roles_1.RoleShorter(this).roles;
14
+ users = new common_1.UsersShorter(this);
15
+ channels = new common_1.ChannelShorter(this);
16
+ guilds = new common_1.GuildShorter(this);
17
+ messages = new common_1.MessageShorter(this);
18
+ members = new common_1.MemberShorter(this);
19
+ webhooks = new common_1.WebhookShorter(this);
20
+ templates = new common_1.TemplateShorter(this);
21
+ roles = new common_1.RoleShorter(this);
22
+ reactions = new common_1.ReactionShorter(this);
23
+ emojis = new common_1.EmojiShorter(this);
27
24
  debugger;
28
25
  logger = new common_1.Logger({
29
26
  name: '[Seyfert]',
@@ -66,7 +63,7 @@ class BaseClient {
66
63
  this.rest = rest;
67
64
  }
68
65
  if (cache) {
69
- this.cache = new cache_1.Cache(this.cache?.intents ?? 0, cache.adapter, cache.disabledCache ?? this.cache?.disabledCache, this);
66
+ this.cache = new cache_1.Cache(this.cache?.intents ?? 0, cache?.adapter ?? this.cache?.adapter ?? new cache_1.MemoryAdapter(), cache.disabledCache ?? this.cache?.disabledCache ?? [], this);
70
67
  }
71
68
  if (langs) {
72
69
  if (langs.default)
@@ -32,6 +32,11 @@ export interface ClientOptions extends BaseClientOptions {
32
32
  shards?: {
33
33
  start: number;
34
34
  end: number;
35
+ total?: number;
36
+ };
37
+ gateway?: {
38
+ properties?: Partial<ShardManagerOptions['properties']>;
39
+ compress?: ShardManagerOptions['compress'];
35
40
  };
36
41
  commands?: {
37
42
  prefix: (message: Message) => Promise<string[]> | string[];
@@ -77,7 +77,10 @@ class Client extends base_1.BaseClient {
77
77
  presence: this.options?.presence,
78
78
  debug: debugRC,
79
79
  shardStart: this.options?.shards?.start,
80
- shardEnd: this.options?.shards?.end,
80
+ shardEnd: this.options?.shards?.end ?? this.options?.shards?.total,
81
+ totalShards: this.options?.shards?.total ?? this.options?.shards?.end,
82
+ properties: { ...this.options?.gateway?.properties, ...websocket_1.properties },
83
+ compress: this.options?.gateway?.compress,
81
84
  });
82
85
  }
83
86
  this.cache.intents = this.gateway.options.intents;
@@ -57,7 +57,7 @@ async function onInteractionCreate(self, body, shardId, __reply) {
57
57
  // idc, is a YOU problem
58
58
  if (!command?.run)
59
59
  return self.logger.warn(`${command.name ?? 'Unknown'} command does not have 'run' callback`);
60
- const context = new commands_1.MenuCommandContext(self, interaction, shardId);
60
+ const context = new commands_1.MenuCommandContext(self, interaction, shardId, command);
61
61
  const extendContext = self.options?.context?.(interaction) ?? {};
62
62
  Object.assign(context, extendContext);
63
63
  try {
@@ -114,7 +114,7 @@ async function onInteractionCreate(self, body, shardId, __reply) {
114
114
  const command = optionsResolver.getCommand();
115
115
  if (!command?.run)
116
116
  return self.logger.warn(`${optionsResolver.fullCommandName} command does not have 'run' callback`);
117
- const context = new commands_1.CommandContext(self, interaction, optionsResolver, shardId);
117
+ const context = new commands_1.CommandContext(self, interaction, optionsResolver, shardId, command);
118
118
  const extendContext = self.options?.context?.(interaction) ?? {};
119
119
  Object.assign(context, extendContext);
120
120
  try {