seyfert 2.1.0 → 2.1.1-dev-11310514874.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.
- package/lib/api/Router.d.ts +2 -2
- package/lib/api/Router.js +2 -1
- package/lib/api/Routes/applications.d.ts +29 -30
- package/lib/api/Routes/cdn.d.ts +6 -1
- package/lib/api/Routes/channels.d.ts +44 -45
- package/lib/api/Routes/gateway.d.ts +3 -4
- package/lib/api/Routes/guilds.d.ts +81 -80
- package/lib/api/Routes/index.d.ts +3 -1
- package/lib/api/Routes/interactions.d.ts +6 -6
- package/lib/api/Routes/invites.d.ts +3 -4
- package/lib/api/Routes/skus.d.ts +4 -5
- package/lib/api/Routes/soundboard.d.ts +23 -0
- package/lib/api/Routes/soundboard.js +2 -0
- package/lib/api/Routes/stage-instances.d.ts +5 -6
- package/lib/api/Routes/stickers.d.ts +3 -4
- package/lib/api/Routes/users.d.ts +11 -12
- package/lib/api/Routes/voice.d.ts +2 -3
- package/lib/api/Routes/webhooks.d.ts +16 -15
- package/lib/api/api.d.ts +17 -11
- package/lib/api/api.js +12 -10
- package/lib/api/shared.d.ts +1 -1
- package/lib/api/utils/constants.d.ts +2 -0
- package/lib/api/utils/constants.js +2 -1
- package/lib/builders/ActionRow.d.ts +1 -1
- package/lib/builders/Attachment.d.ts +2 -2
- package/lib/builders/Attachment.js +1 -1
- package/lib/builders/Button.d.ts +1 -1
- package/lib/builders/Button.js +1 -1
- package/lib/builders/Embed.d.ts +1 -1
- package/lib/builders/Embed.js +2 -2
- package/lib/builders/Modal.d.ts +1 -1
- package/lib/builders/Poll.d.ts +1 -1
- package/lib/builders/Poll.js +1 -1
- package/lib/builders/SelectMenu.d.ts +1 -1
- package/lib/builders/SelectMenu.js +1 -1
- package/lib/builders/types.d.ts +2 -1
- package/lib/cache/adapters/default.js +5 -3
- package/lib/cache/adapters/limited.d.ts +1 -2
- package/lib/cache/adapters/limited.js +34 -30
- package/lib/cache/adapters/workeradapter.js +3 -1
- package/lib/cache/index.d.ts +8 -11
- package/lib/cache/index.js +38 -37
- package/lib/cache/resources/bans.d.ts +2 -2
- package/lib/cache/resources/bans.js +1 -1
- package/lib/cache/resources/channels.d.ts +1 -1
- package/lib/cache/resources/default/guild-related.d.ts +1 -2
- package/lib/cache/resources/emojis.d.ts +2 -2
- package/lib/cache/resources/emojis.js +1 -1
- package/lib/cache/resources/guilds.d.ts +2 -2
- package/lib/cache/resources/guilds.js +7 -11
- package/lib/cache/resources/members.d.ts +2 -2
- package/lib/cache/resources/members.js +1 -1
- package/lib/cache/resources/messages.d.ts +2 -2
- package/lib/cache/resources/messages.js +3 -3
- package/lib/cache/resources/overwrites.d.ts +1 -1
- package/lib/cache/resources/roles.d.ts +2 -2
- package/lib/cache/resources/roles.js +1 -1
- package/lib/cache/resources/stickers.d.ts +2 -2
- package/lib/cache/resources/stickers.js +1 -1
- package/lib/cache/resources/users.d.ts +2 -2
- package/lib/cache/resources/users.js +1 -1
- package/lib/cache/resources/voice-states.d.ts +2 -2
- package/lib/cache/resources/voice-states.js +1 -1
- package/lib/client/base.d.ts +9 -14
- package/lib/client/base.js +43 -44
- package/lib/client/client.d.ts +3 -7
- package/lib/client/client.js +24 -41
- package/lib/client/collectors.js +1 -1
- package/lib/client/httpclient.d.ts +1 -1
- package/lib/client/transformers.d.ts +37 -34
- package/lib/client/transformers.js +66 -63
- package/lib/client/workerclient.d.ts +10 -11
- package/lib/client/workerclient.js +180 -75
- package/lib/collection.d.ts +3 -3
- package/lib/commands/applications/chat.d.ts +3 -3
- package/lib/commands/applications/chat.js +5 -6
- package/lib/commands/applications/chatcontext.d.ts +6 -6
- package/lib/commands/applications/chatcontext.js +16 -8
- package/lib/commands/applications/entryPoint.d.ts +1 -1
- package/lib/commands/applications/entrycontext.d.ts +6 -6
- package/lib/commands/applications/entrycontext.js +4 -4
- package/lib/commands/applications/menu.d.ts +1 -1
- package/lib/commands/applications/menucontext.d.ts +5 -5
- package/lib/commands/applications/menucontext.js +6 -6
- package/lib/commands/applications/options.d.ts +4 -4
- package/lib/commands/applications/shared.d.ts +5 -2
- package/lib/commands/basecontext.d.ts +1 -1
- package/lib/commands/decorators.d.ts +10 -10
- package/lib/commands/decorators.js +5 -4
- package/lib/commands/handle.d.ts +9 -9
- package/lib/commands/handle.js +94 -68
- package/lib/commands/handler.d.ts +5 -5
- package/lib/commands/handler.js +21 -17
- package/lib/commands/optionresolver.d.ts +4 -4
- package/lib/commands/optionresolver.js +3 -3
- package/lib/common/it/formatter.d.ts +21 -21
- package/lib/common/it/formatter.js +40 -41
- package/lib/common/it/logger.js +1 -1
- package/lib/common/it/utils.d.ts +4 -3
- package/lib/common/it/utils.js +52 -27
- package/lib/common/shorters/application.d.ts +2 -3
- package/lib/common/shorters/application.js +3 -3
- package/lib/common/shorters/bans.js +1 -1
- package/lib/common/shorters/channels.d.ts +3 -3
- package/lib/common/shorters/channels.js +3 -3
- package/lib/common/shorters/emojis.js +4 -4
- package/lib/common/shorters/guilds.d.ts +3 -3
- package/lib/common/shorters/guilds.js +5 -9
- package/lib/common/shorters/interaction.d.ts +3 -3
- package/lib/common/shorters/interaction.js +6 -5
- package/lib/common/shorters/members.d.ts +4 -5
- package/lib/common/shorters/members.js +6 -7
- package/lib/common/shorters/messages.d.ts +1 -1
- package/lib/common/shorters/messages.js +4 -4
- package/lib/common/shorters/reactions.d.ts +1 -1
- package/lib/common/shorters/reactions.js +1 -1
- package/lib/common/shorters/roles.js +1 -1
- package/lib/common/shorters/templates.js +2 -2
- package/lib/common/shorters/threads.d.ts +1 -1
- package/lib/common/shorters/threads.js +17 -11
- package/lib/common/shorters/webhook.d.ts +1 -1
- package/lib/common/shorters/webhook.js +4 -4
- package/lib/common/types/options.d.ts +2 -2
- package/lib/common/types/resolvables.d.ts +1 -1
- package/lib/common/types/util.d.ts +4 -1
- package/lib/common/types/write.d.ts +1 -1
- package/lib/components/BaseComponent.js +1 -1
- package/lib/components/ButtonComponent.d.ts +1 -1
- package/lib/components/componentcommand.d.ts +1 -1
- package/lib/components/componentcontext.d.ts +4 -4
- package/lib/components/componentcontext.js +1 -1
- package/lib/components/handler.d.ts +10 -8
- package/lib/components/handler.js +16 -13
- package/lib/components/index.js +2 -1
- package/lib/components/modalcontext.d.ts +2 -2
- package/lib/components/modalcontext.js +1 -1
- package/lib/deps/mixer.d.ts +1 -1
- package/lib/events/handler.d.ts +5 -5
- package/lib/events/handler.js +66 -16
- package/lib/events/hooks/application_command.d.ts +1 -1
- package/lib/events/hooks/auto_moderation.d.ts +1 -1
- package/lib/events/hooks/auto_moderation.js +1 -1
- package/lib/events/hooks/channel.d.ts +1 -1
- package/lib/events/hooks/dispatch.d.ts +1 -1
- package/lib/events/hooks/entitlement.d.ts +4 -5
- package/lib/events/hooks/entitlement.js +4 -4
- package/lib/events/hooks/guild.d.ts +3 -3
- package/lib/events/hooks/guild.js +1 -1
- package/lib/events/hooks/index.d.ts +1 -0
- package/lib/events/hooks/index.js +1 -0
- package/lib/events/hooks/integration.d.ts +1 -1
- package/lib/events/hooks/integration.js +1 -1
- package/lib/events/hooks/interactions.d.ts +3 -3
- package/lib/events/hooks/invite.d.ts +1 -1
- package/lib/events/hooks/message.d.ts +3 -3
- package/lib/events/hooks/message.js +1 -1
- package/lib/events/hooks/presence.d.ts +2 -2
- package/lib/events/hooks/soundboard.d.ts +155 -0
- package/lib/events/hooks/soundboard.js +28 -0
- package/lib/events/hooks/stage.d.ts +2 -2
- package/lib/events/hooks/thread.d.ts +2 -2
- package/lib/events/hooks/thread.js +2 -2
- package/lib/events/hooks/typing.d.ts +1 -1
- package/lib/events/hooks/typing.js +1 -1
- package/lib/events/hooks/user.d.ts +2 -2
- package/lib/events/hooks/voice.d.ts +2 -2
- package/lib/events/hooks/voice.js +1 -1
- package/lib/events/hooks/webhook.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -5
- package/lib/langs/handler.d.ts +2 -2
- package/lib/structures/Guild.d.ts +7 -4
- package/lib/structures/Guild.js +1 -1
- package/lib/structures/GuildBan.d.ts +1 -1
- package/lib/structures/GuildMember.d.ts +7 -5
- package/lib/structures/GuildMember.js +5 -3
- package/lib/structures/GuildRole.d.ts +1 -1
- package/lib/structures/GuildTemplate.d.ts +1 -1
- package/lib/structures/Interaction.d.ts +17 -14
- package/lib/structures/Interaction.js +28 -21
- package/lib/structures/Message.d.ts +4 -7
- package/lib/structures/Message.js +5 -5
- package/lib/structures/Poll.d.ts +3 -3
- package/lib/structures/Sticker.d.ts +2 -2
- package/lib/structures/Sticker.js +1 -1
- package/lib/structures/VoiceState.d.ts +2 -1
- package/lib/structures/VoiceState.js +1 -1
- package/lib/structures/Webhook.d.ts +3 -3
- package/lib/structures/Webhook.js +1 -1
- package/lib/structures/channels.d.ts +4 -4
- package/lib/structures/channels.js +6 -5
- package/lib/structures/extra/BitField.d.ts +3 -3
- package/lib/structures/extra/BitField.js +34 -33
- package/lib/structures/extra/DiscordBase.js +1 -1
- package/lib/structures/extra/Permissions.d.ts +2 -0
- package/lib/structures/extra/Permissions.js +21 -0
- package/lib/types/gateway.d.ts +53 -5
- package/lib/types/payloads/_interactions/base.d.ts +1 -1
- package/lib/types/payloads/channel.d.ts +2 -2
- package/lib/types/payloads/guild.d.ts +9 -1
- package/lib/types/payloads/guild.js +8 -0
- package/lib/types/payloads/index.d.ts +1 -0
- package/lib/types/payloads/index.js +1 -0
- package/lib/types/payloads/soundboard.d.ts +23 -0
- package/lib/types/payloads/soundboard.js +5 -0
- package/lib/types/payloads/user.js +0 -1
- package/lib/types/rest/application.d.ts +3 -3
- package/lib/types/rest/auditLog.d.ts +1 -1
- package/lib/types/rest/channel.d.ts +2 -2
- package/lib/types/rest/guild.d.ts +2 -2
- package/lib/types/rest/guildScheduledEvent.d.ts +1 -1
- package/lib/types/rest/index.d.ts +1 -0
- package/lib/types/rest/index.js +1 -0
- package/lib/types/rest/oauth2.d.ts +1 -1
- package/lib/types/rest/poll.d.ts +1 -1
- package/lib/types/rest/soundboard.d.ts +64 -0
- package/lib/types/rest/soundboard.js +2 -0
- package/lib/types/rest/stageInstance.d.ts +1 -1
- package/lib/types/rest/template.d.ts +1 -1
- package/lib/types/rest/user.d.ts +1 -1
- package/lib/types/rest/webhook.d.ts +1 -1
- package/lib/types/utils/index.d.ts +11 -2
- package/lib/types/utils/index.js +10 -2
- package/lib/websocket/SharedTypes.d.ts +11 -2
- package/lib/websocket/constants/index.js +0 -10
- package/lib/websocket/discord/basesocket.d.ts +1 -1
- package/lib/websocket/discord/shard.d.ts +1 -1
- package/lib/websocket/discord/shard.js +25 -16
- package/lib/websocket/discord/sharder.d.ts +9 -6
- package/lib/websocket/discord/sharder.js +91 -74
- package/lib/websocket/discord/shared.d.ts +3 -14
- package/lib/websocket/discord/socket/custom.js +19 -6
- package/lib/websocket/discord/worker.d.ts +8 -2
- package/lib/websocket/discord/workermanager.d.ts +42 -17
- package/lib/websocket/discord/workermanager.js +144 -37
- package/lib/websocket/structures/timeout.d.ts +4 -5
- package/lib/websocket/structures/timeout.js +23 -24
- package/package.json +72 -70
- package/lib/cache/resources/threads.d.ts +0 -14
- package/lib/cache/resources/threads.js +0 -32
package/lib/cache/index.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.Cache = exports.GuildBasedResource = exports.GuildRelatedResource = expo
|
|
|
18
18
|
const common_1 = require("../common");
|
|
19
19
|
const guilds_1 = require("./resources/guilds");
|
|
20
20
|
const users_1 = require("./resources/users");
|
|
21
|
+
const bans_1 = require("./resources/bans");
|
|
21
22
|
const channels_1 = require("./resources/channels");
|
|
22
23
|
const emojis_1 = require("./resources/emojis");
|
|
23
24
|
const members_1 = require("./resources/members");
|
|
@@ -25,12 +26,10 @@ const presence_1 = require("./resources/presence");
|
|
|
25
26
|
const roles_1 = require("./resources/roles");
|
|
26
27
|
const stage_instances_1 = require("./resources/stage-instances");
|
|
27
28
|
const stickers_1 = require("./resources/stickers");
|
|
28
|
-
const threads_1 = require("./resources/threads");
|
|
29
29
|
const voice_states_1 = require("./resources/voice-states");
|
|
30
|
-
const bans_1 = require("./resources/bans");
|
|
31
30
|
const types_1 = require("../types");
|
|
32
|
-
const overwrites_1 = require("./resources/overwrites");
|
|
33
31
|
const messages_1 = require("./resources/messages");
|
|
32
|
+
const overwrites_1 = require("./resources/overwrites");
|
|
34
33
|
var base_1 = require("./resources/default/base");
|
|
35
34
|
Object.defineProperty(exports, "BaseResource", { enumerable: true, get: function () { return base_1.BaseResource; } });
|
|
36
35
|
var guild_related_1 = require("./resources/default/guild-related");
|
|
@@ -52,7 +51,6 @@ class Cache {
|
|
|
52
51
|
overwrites;
|
|
53
52
|
roles;
|
|
54
53
|
emojis;
|
|
55
|
-
threads;
|
|
56
54
|
channels;
|
|
57
55
|
stickers;
|
|
58
56
|
presences;
|
|
@@ -97,9 +95,6 @@ class Cache {
|
|
|
97
95
|
if (!this.disabledCache.presences) {
|
|
98
96
|
this.presences = new presence_1.Presences(this, client);
|
|
99
97
|
}
|
|
100
|
-
if (!this.disabledCache.threads) {
|
|
101
|
-
this.threads = new threads_1.Threads(this, client);
|
|
102
|
-
}
|
|
103
98
|
if (!this.disabledCache.stageInstances) {
|
|
104
99
|
this.stageInstances = new stage_instances_1.StageInstances(this, client);
|
|
105
100
|
}
|
|
@@ -111,7 +106,9 @@ class Cache {
|
|
|
111
106
|
}
|
|
112
107
|
if (this.disabledCache.onPacket) {
|
|
113
108
|
//@ts-expect-error
|
|
114
|
-
this.onPacket = () => {
|
|
109
|
+
this.onPacket = () => {
|
|
110
|
+
// disable cache
|
|
111
|
+
};
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
114
|
/** @internal */
|
|
@@ -126,7 +123,6 @@ class Cache {
|
|
|
126
123
|
this.emojis?.__setClient(client);
|
|
127
124
|
this.stickers?.__setClient(client);
|
|
128
125
|
this.presences?.__setClient(client);
|
|
129
|
-
this.threads?.__setClient(client);
|
|
130
126
|
this.stageInstances?.__setClient(client);
|
|
131
127
|
this.messages?.__setClient(client);
|
|
132
128
|
this.bans?.__setClient(client);
|
|
@@ -150,8 +146,8 @@ class Cache {
|
|
|
150
146
|
get hasGuildMembersIntent() {
|
|
151
147
|
return this.hasIntent('GuildMembers');
|
|
152
148
|
}
|
|
153
|
-
get
|
|
154
|
-
return this.hasIntent('
|
|
149
|
+
get hasGuildExpressionsIntent() {
|
|
150
|
+
return this.hasIntent('GuildExpressions');
|
|
155
151
|
}
|
|
156
152
|
get hasVoiceStatesIntent() {
|
|
157
153
|
return this.hasIntent('GuildVoiceStates');
|
|
@@ -179,7 +175,6 @@ class Cache {
|
|
|
179
175
|
}
|
|
180
176
|
break;
|
|
181
177
|
case 'roles':
|
|
182
|
-
case 'threads':
|
|
183
178
|
case 'stickers':
|
|
184
179
|
case 'channels':
|
|
185
180
|
case 'presences':
|
|
@@ -222,7 +217,6 @@ class Cache {
|
|
|
222
217
|
for (const [type, data, id, guildId] of keys) {
|
|
223
218
|
switch (type) {
|
|
224
219
|
case 'roles':
|
|
225
|
-
case 'threads':
|
|
226
220
|
case 'stickers':
|
|
227
221
|
case 'channels':
|
|
228
222
|
case 'presences':
|
|
@@ -294,7 +288,6 @@ class Cache {
|
|
|
294
288
|
for (const [type, data, id, guildId] of keys) {
|
|
295
289
|
switch (type) {
|
|
296
290
|
case 'roles':
|
|
297
|
-
case 'threads':
|
|
298
291
|
case 'stickers':
|
|
299
292
|
case 'channels':
|
|
300
293
|
case 'presences':
|
|
@@ -379,15 +372,17 @@ class Cache {
|
|
|
379
372
|
break;
|
|
380
373
|
case 'CHANNEL_CREATE':
|
|
381
374
|
case 'CHANNEL_UPDATE':
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
375
|
+
{
|
|
376
|
+
if ('guild_id' in event.d) {
|
|
377
|
+
await this.channels?.set(event.d.id, event.d.guild_id, event.d);
|
|
378
|
+
if (event.d.permission_overwrites?.length)
|
|
379
|
+
await this.overwrites?.set(event.d.id, event.d.guild_id, event.d.permission_overwrites);
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
if (event.d.type === types_1.ChannelType.DM) {
|
|
383
|
+
await this.channels?.set(event.d.recipients[0]?.id, '@me', event.d);
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
391
386
|
}
|
|
392
387
|
break;
|
|
393
388
|
case 'CHANNEL_DELETE':
|
|
@@ -407,12 +402,16 @@ class Cache {
|
|
|
407
402
|
await this.bans?.remove(event.d.user.id, event.d.guild_id);
|
|
408
403
|
break;
|
|
409
404
|
case 'GUILD_EMOJIS_UPDATE':
|
|
410
|
-
|
|
411
|
-
|
|
405
|
+
{
|
|
406
|
+
await this.emojis?.remove(await this.emojis?.keys(event.d.guild_id), event.d.guild_id);
|
|
407
|
+
await this.emojis?.set(event.d.emojis.map(x => [x.id, x]), event.d.guild_id);
|
|
408
|
+
}
|
|
412
409
|
break;
|
|
413
410
|
case 'GUILD_STICKERS_UPDATE':
|
|
414
|
-
|
|
415
|
-
|
|
411
|
+
{
|
|
412
|
+
await this.stickers?.remove(await this.stickers?.keys(event.d.guild_id), event.d.guild_id);
|
|
413
|
+
await this.stickers?.set(event.d.stickers.map(x => [x.id, x]), event.d.guild_id);
|
|
414
|
+
}
|
|
416
415
|
break;
|
|
417
416
|
case 'GUILD_MEMBER_ADD':
|
|
418
417
|
case 'GUILD_MEMBER_UPDATE':
|
|
@@ -429,23 +428,25 @@ class Cache {
|
|
|
429
428
|
case 'THREAD_CREATE':
|
|
430
429
|
case 'THREAD_UPDATE':
|
|
431
430
|
if (event.d.guild_id)
|
|
432
|
-
await this.
|
|
431
|
+
await this.channels?.set(event.d.id, event.d.guild_id, event.d);
|
|
433
432
|
break;
|
|
434
433
|
case 'THREAD_DELETE':
|
|
435
|
-
await this.
|
|
434
|
+
await this.channels?.remove(event.d.id, event.d.guild_id);
|
|
436
435
|
break;
|
|
437
436
|
case 'USER_UPDATE':
|
|
438
437
|
await this.users?.set(event.d.id, event.d);
|
|
439
438
|
break;
|
|
440
439
|
case 'VOICE_STATE_UPDATE':
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
440
|
+
{
|
|
441
|
+
if (!event.d.guild_id) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
if (event.d.channel_id != null) {
|
|
445
|
+
await this.voiceStates?.set(event.d.user_id, event.d.guild_id, event.d);
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
await this.voiceStates?.remove(event.d.user_id, event.d.guild_id);
|
|
449
|
+
}
|
|
449
450
|
}
|
|
450
451
|
break;
|
|
451
452
|
case 'STAGE_INSTANCE_CREATE':
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APIBan, GatewayGuildBanModifyDispatchData } from '../../types';
|
|
2
1
|
import type { ReturnCache } from '../..';
|
|
3
|
-
import { GuildBasedResource } from './default/guild-based';
|
|
4
2
|
import { type GuildBanStructure } from '../../client/transformers';
|
|
3
|
+
import type { APIBan, GatewayGuildBanModifyDispatchData } from '../../types';
|
|
4
|
+
import { GuildBasedResource } from './default/guild-based';
|
|
5
5
|
export declare class Bans extends GuildBasedResource<any, GatewayGuildBanModifyDispatchData | APIBan> {
|
|
6
6
|
namespace: string;
|
|
7
7
|
filter(data: APIBan, id: string, guild_id: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Bans = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
const guild_based_1 = require("./default/guild-based");
|
|
6
|
-
const transformers_1 = require("../../client/transformers");
|
|
7
7
|
class Bans extends guild_based_1.GuildBasedResource {
|
|
8
8
|
namespace = 'ban';
|
|
9
9
|
//@ts-expect-error
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { type AllChannels, channelFrom } from '../../structures';
|
|
1
2
|
import type { APIChannel } from '../../types';
|
|
2
|
-
import { channelFrom, type AllChannels } from '../../structures';
|
|
3
3
|
import type { ReturnCache } from '../index';
|
|
4
4
|
import { GuildRelatedResource } from './default/guild-related';
|
|
5
5
|
export declare class Channels extends GuildRelatedResource<any, APIChannel> {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { BaseClient } from '../../../client/base';
|
|
2
1
|
import type { UsingClient } from '../../../commands';
|
|
3
2
|
import type { GatewayIntentBits } from '../../../types';
|
|
4
3
|
import type { Cache, ReturnCache } from '../../index';
|
|
5
4
|
export declare class GuildRelatedResource<T = any, S = any> {
|
|
6
5
|
protected cache: Cache;
|
|
7
|
-
client:
|
|
6
|
+
client: UsingClient;
|
|
8
7
|
namespace: string;
|
|
9
8
|
constructor(cache: Cache, client?: UsingClient);
|
|
10
9
|
filter(data: any, id: string, guild_id?: string): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APIEmoji } from '../../types';
|
|
2
1
|
import type { ReturnCache } from '../..';
|
|
3
|
-
import { GuildRelatedResource } from './default/guild-related';
|
|
4
2
|
import { type GuildEmojiStructure } from '../../client/transformers';
|
|
3
|
+
import type { APIEmoji } from '../../types';
|
|
4
|
+
import { GuildRelatedResource } from './default/guild-related';
|
|
5
5
|
export declare class Emojis extends GuildRelatedResource<any, APIEmoji> {
|
|
6
6
|
namespace: string;
|
|
7
7
|
filter(data: APIEmoji, id: string, guild_id?: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Emojis = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
const guild_related_1 = require("./default/guild-related");
|
|
6
|
-
const transformers_1 = require("../../client/transformers");
|
|
7
7
|
class Emojis extends guild_related_1.GuildRelatedResource {
|
|
8
8
|
namespace = 'emoji';
|
|
9
9
|
//@ts-expect-error
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APIGuild, GatewayGuildCreateDispatchData } from '../../types';
|
|
2
1
|
import type { ReturnCache } from '..';
|
|
3
|
-
import { BaseResource } from './default/base';
|
|
4
2
|
import { type GuildStructure } from '../../client/transformers';
|
|
3
|
+
import type { APIGuild, GatewayGuildCreateDispatchData } from '../../types';
|
|
4
|
+
import { BaseResource } from './default/base';
|
|
5
5
|
export declare class Guilds extends BaseResource<any, APIGuild | GatewayGuildCreateDispatchData> {
|
|
6
6
|
namespace: string;
|
|
7
7
|
filter(data: APIGuild, id: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Guilds = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
const base_1 = require("./default/base");
|
|
6
|
-
const transformers_1 = require("../../client/transformers");
|
|
7
7
|
class Guilds extends base_1.BaseResource {
|
|
8
8
|
namespace = 'guild';
|
|
9
9
|
//@ts-expect-error
|
|
@@ -38,7 +38,6 @@ class Guilds extends base_1.BaseResource {
|
|
|
38
38
|
this.cache.stickers?.keys(id) ?? [],
|
|
39
39
|
this.cache.voiceStates?.keys(id) ?? [],
|
|
40
40
|
this.cache.presences?.keys(id) ?? [],
|
|
41
|
-
this.cache.threads?.keys(id) ?? [],
|
|
42
41
|
this.cache.stageInstances?.keys(id) ?? [],
|
|
43
42
|
this.cache.bans?.keys(id) ?? [],
|
|
44
43
|
])).flat());
|
|
@@ -60,7 +59,6 @@ class Guilds extends base_1.BaseResource {
|
|
|
60
59
|
this.cache.stickers?.hashId(id),
|
|
61
60
|
this.cache.voiceStates?.hashId(id),
|
|
62
61
|
this.cache.presences?.hashId(id),
|
|
63
|
-
this.cache.threads?.hashId(id),
|
|
64
62
|
this.cache.stageInstances?.hashId(id),
|
|
65
63
|
].filter(Boolean));
|
|
66
64
|
await super.remove(id);
|
|
@@ -82,6 +80,9 @@ class Guilds extends base_1.BaseResource {
|
|
|
82
80
|
if (channel.permission_overwrites?.length)
|
|
83
81
|
bulkData.push(['overwrites', channel.permission_overwrites, channel.id, id]);
|
|
84
82
|
}
|
|
83
|
+
for (const thread of data.threads ?? []) {
|
|
84
|
+
bulkData.push(['channels', thread, thread.id, id]);
|
|
85
|
+
}
|
|
85
86
|
for (const emoji of data.emojis ?? []) {
|
|
86
87
|
bulkData.push(['emojis', emoji, emoji.id, id]);
|
|
87
88
|
}
|
|
@@ -94,9 +95,6 @@ class Guilds extends base_1.BaseResource {
|
|
|
94
95
|
for (const presence of data.presences ?? []) {
|
|
95
96
|
bulkData.push(['presences', presence, presence.user.id, id]);
|
|
96
97
|
}
|
|
97
|
-
for (const thread of data.threads ?? []) {
|
|
98
|
-
bulkData.push(['threads', thread, thread.id, id]);
|
|
99
|
-
}
|
|
100
98
|
for (const instance of data.stage_instances ?? []) {
|
|
101
99
|
bulkData.push(['stageInstances', instance, instance.id, id]);
|
|
102
100
|
}
|
|
@@ -118,12 +116,13 @@ class Guilds extends base_1.BaseResource {
|
|
|
118
116
|
}
|
|
119
117
|
for (const channel of data.channels ?? []) {
|
|
120
118
|
bulkData.push(['channels', channel, channel.id, id]);
|
|
121
|
-
}
|
|
122
|
-
for (const channel of data.channels ?? []) {
|
|
123
119
|
if (channel.permission_overwrites?.length) {
|
|
124
120
|
bulkData.push(['overwrites', channel.permission_overwrites, channel.id, id]);
|
|
125
121
|
}
|
|
126
122
|
}
|
|
123
|
+
for (const thread of data.threads ?? []) {
|
|
124
|
+
bulkData.push(['channels', thread, thread.id, id]);
|
|
125
|
+
}
|
|
127
126
|
for (const emoji of data.emojis ?? []) {
|
|
128
127
|
bulkData.push(['emojis', emoji, emoji.id, id]);
|
|
129
128
|
}
|
|
@@ -136,9 +135,6 @@ class Guilds extends base_1.BaseResource {
|
|
|
136
135
|
for (const presence of data.presences ?? []) {
|
|
137
136
|
bulkData.push(['presences', presence, presence.user.id, id]);
|
|
138
137
|
}
|
|
139
|
-
for (const thread of data.threads ?? []) {
|
|
140
|
-
bulkData.push(['threads', thread, thread.id, id]);
|
|
141
|
-
}
|
|
142
138
|
for (const instance of data.stage_instances ?? []) {
|
|
143
139
|
bulkData.push(['stageInstances', instance, instance.id, id]);
|
|
144
140
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APIGuildMember } from '../../types';
|
|
2
1
|
import type { ReturnCache } from '../..';
|
|
3
|
-
import { GuildBasedResource } from './default/guild-based';
|
|
4
2
|
import { type GuildMemberStructure } from '../../client/transformers';
|
|
3
|
+
import type { APIGuildMember } from '../../types';
|
|
4
|
+
import { GuildBasedResource } from './default/guild-based';
|
|
5
5
|
export declare class Members extends GuildBasedResource<any, APIGuildMember> {
|
|
6
6
|
namespace: string;
|
|
7
7
|
filter(data: APIGuildMember, id: string, guild_id: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Members = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
const guild_based_1 = require("./default/guild-based");
|
|
6
|
-
const transformers_1 = require("../../client/transformers");
|
|
7
7
|
class Members extends guild_based_1.GuildBasedResource {
|
|
8
8
|
namespace = 'member';
|
|
9
9
|
//@ts-expect-error
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APIMessage } from '../../types';
|
|
2
|
-
import { GuildRelatedResource } from './default/guild-related';
|
|
3
1
|
import type { MessageData, ReturnCache } from '../..';
|
|
4
2
|
import { type MessageStructure } from '../../client/transformers';
|
|
3
|
+
import type { APIMessage } from '../../types';
|
|
4
|
+
import { GuildRelatedResource } from './default/guild-related';
|
|
5
5
|
export declare class Messages extends GuildRelatedResource<any, APIMessage> {
|
|
6
6
|
namespace: string;
|
|
7
7
|
filter(data: MessageData, id: string, channel_id?: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Messages = void 0;
|
|
4
|
-
const guild_related_1 = require("./default/guild-related");
|
|
5
|
-
const common_1 = require("../../common");
|
|
6
4
|
const transformers_1 = require("../../client/transformers");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
const guild_related_1 = require("./default/guild-related");
|
|
7
7
|
class Messages extends guild_related_1.GuildRelatedResource {
|
|
8
8
|
namespace = 'message';
|
|
9
9
|
//@ts-expect-error
|
|
@@ -45,7 +45,7 @@ class Messages extends guild_related_1.GuildRelatedResource {
|
|
|
45
45
|
values(channel) {
|
|
46
46
|
return (0, common_1.fakePromise)(super.values(channel)).then(messages => {
|
|
47
47
|
const hashes = this.cache.users
|
|
48
|
-
? messages.map(x => (x.user_id ? this.cache.users
|
|
48
|
+
? messages.map(x => (x.user_id ? this.cache.users?.hashId(x.user_id) : undefined))
|
|
49
49
|
: [];
|
|
50
50
|
return (0, common_1.fakePromise)(this.cache.adapter.bulkGet(hashes.filter(Boolean))).then(users => {
|
|
51
51
|
return messages
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { APIOverwrite } from '../../types';
|
|
2
1
|
import type { ReturnCache } from '../..';
|
|
3
2
|
import { PermissionsBitField } from '../../structures/extra/Permissions';
|
|
3
|
+
import type { APIOverwrite } from '../../types';
|
|
4
4
|
import { GuildRelatedResource } from './default/guild-related';
|
|
5
5
|
export declare class Overwrites extends GuildRelatedResource<any, APIOverwrite[]> {
|
|
6
6
|
namespace: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APIRole } from '../../types';
|
|
2
1
|
import type { ReturnCache } from '../..';
|
|
3
|
-
import { GuildRelatedResource } from './default/guild-related';
|
|
4
2
|
import { type GuildRoleStructure } from '../../client/transformers';
|
|
3
|
+
import type { APIRole } from '../../types';
|
|
4
|
+
import { GuildRelatedResource } from './default/guild-related';
|
|
5
5
|
export declare class Roles extends GuildRelatedResource<any, APIRole> {
|
|
6
6
|
namespace: string;
|
|
7
7
|
filter(data: APIRole, id: string, guild_id?: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Roles = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
const guild_related_1 = require("./default/guild-related");
|
|
6
|
-
const transformers_1 = require("../../client/transformers");
|
|
7
7
|
class Roles extends guild_related_1.GuildRelatedResource {
|
|
8
8
|
namespace = 'role';
|
|
9
9
|
//@ts-expect-error
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APISticker } from '../../types';
|
|
2
1
|
import type { ReturnCache } from '../..';
|
|
3
|
-
import { GuildRelatedResource } from './default/guild-related';
|
|
4
2
|
import { type StickerStructure } from '../../client/transformers';
|
|
3
|
+
import type { APISticker } from '../../types';
|
|
4
|
+
import { GuildRelatedResource } from './default/guild-related';
|
|
5
5
|
export declare class Stickers extends GuildRelatedResource<any, APISticker> {
|
|
6
6
|
namespace: string;
|
|
7
7
|
filter(data: APISticker, id: string, guild_id?: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Stickers = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
const guild_related_1 = require("./default/guild-related");
|
|
6
|
-
const transformers_1 = require("../../client/transformers");
|
|
7
7
|
class Stickers extends guild_related_1.GuildRelatedResource {
|
|
8
8
|
namespace = 'sticker';
|
|
9
9
|
//@ts-expect-error
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APIUser } from '../../types';
|
|
2
1
|
import type { ReturnCache } from '../..';
|
|
3
|
-
import { BaseResource } from './default/base';
|
|
4
2
|
import { type UserStructure } from '../../client/transformers';
|
|
3
|
+
import type { APIUser } from '../../types';
|
|
4
|
+
import { BaseResource } from './default/base';
|
|
5
5
|
export declare class Users extends BaseResource<any, APIUser> {
|
|
6
6
|
namespace: string;
|
|
7
7
|
filter(data: APIUser, id: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Users = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
const base_1 = require("./default/base");
|
|
6
|
-
const transformers_1 = require("../../client/transformers");
|
|
7
7
|
class Users extends base_1.BaseResource {
|
|
8
8
|
namespace = 'user';
|
|
9
9
|
//@ts-expect-error
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { APIVoiceState } from '../../types';
|
|
2
1
|
import type { ReturnCache } from '../..';
|
|
3
|
-
import { GuildBasedResource } from './default/guild-based';
|
|
4
2
|
import { type VoiceStateStructure } from '../../client/transformers';
|
|
3
|
+
import type { APIVoiceState } from '../../types';
|
|
4
|
+
import { GuildBasedResource } from './default/guild-based';
|
|
5
5
|
export declare class VoiceStates extends GuildBasedResource<any, APIVoiceState> {
|
|
6
6
|
namespace: string;
|
|
7
7
|
filter(data: APIVoiceState, id: string, guild_id: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VoiceStates = void 0;
|
|
4
|
+
const transformers_1 = require("../../client/transformers");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
const guild_based_1 = require("./default/guild-based");
|
|
6
|
-
const transformers_1 = require("../../client/transformers");
|
|
7
7
|
class VoiceStates extends guild_based_1.GuildBasedResource {
|
|
8
8
|
namespace = 'voice_state';
|
|
9
9
|
//@ts-expect-error
|
package/lib/client/base.d.ts
CHANGED
|
@@ -4,15 +4,15 @@ import { Cache } from '../cache';
|
|
|
4
4
|
import type { Command, CommandContext, ContextMenuCommand, ExtraProps, MenuCommandContext, RegisteredMiddlewares, SubCommand, UsingClient } from '../commands';
|
|
5
5
|
import { type InferWithPrefix, type MiddlewareContext } from '../commands/applications/shared';
|
|
6
6
|
import { CommandHandler } from '../commands/handler';
|
|
7
|
-
import { ApplicationShorter, ChannelShorter, EmojiShorter, GuildShorter, InteractionShorter, Logger, MemberShorter, MessageShorter, ReactionShorter, RoleShorter, TemplateShorter, ThreadShorter, UsersShorter, WebhookShorter
|
|
8
|
-
import
|
|
7
|
+
import { ApplicationShorter, ChannelShorter, EmojiShorter, GuildShorter, InteractionShorter, Logger, type MakeRequired, MemberShorter, MessageShorter, ReactionShorter, RoleShorter, TemplateShorter, ThreadShorter, UsersShorter, WebhookShorter } from '../common';
|
|
8
|
+
import { HandleCommand } from '../commands/handle';
|
|
9
|
+
import { BanShorter } from '../common/shorters/bans';
|
|
9
10
|
import type { Awaitable, DeepPartial, IntentStrings, OmitInsert, PermissionStrings, When } from '../common/types/util';
|
|
11
|
+
import type { ComponentCommand, ModalCommand } from '../components';
|
|
10
12
|
import { ComponentHandler } from '../components/handler';
|
|
11
13
|
import { LangsHandler } from '../langs/handler';
|
|
12
14
|
import type { ChatInputCommandInteraction, ComponentInteraction, EntryPointInteraction, MessageCommandInteraction, ModalSubmitInteraction, UserCommandInteraction } from '../structures';
|
|
13
|
-
import type {
|
|
14
|
-
import { BanShorter } from '../common/shorters/bans';
|
|
15
|
-
import { HandleCommand } from '../commands/handle';
|
|
15
|
+
import type { LocaleString, RESTPostAPIChannelMessageJSONBody } from '../types';
|
|
16
16
|
import type { MessageStructure } from './transformers';
|
|
17
17
|
export declare class BaseClient {
|
|
18
18
|
rest: ApiHandler;
|
|
@@ -44,12 +44,12 @@ export declare class BaseClient {
|
|
|
44
44
|
protected static getBotIdFromToken(token: string): string;
|
|
45
45
|
options: BaseClientOptions;
|
|
46
46
|
constructor(options?: BaseClientOptions);
|
|
47
|
+
get proxy(): import("../api").APIRoutes;
|
|
47
48
|
set botId(id: string);
|
|
48
49
|
get botId(): string;
|
|
49
50
|
set applicationId(id: string);
|
|
50
51
|
get applicationId(): string;
|
|
51
|
-
|
|
52
|
-
setServices({ rest, cache, langs, middlewares, handlers, handleCommand }: ServicesOptions): void;
|
|
52
|
+
setServices({ rest, cache, langs, middlewares, handleCommand }: ServicesOptions): void;
|
|
53
53
|
protected execute(..._options: unknown[]): Promise<void>;
|
|
54
54
|
start(options?: Pick<DeepPartial<StartOptions>, 'langsDir' | 'commandsDir' | 'connection' | 'token' | 'componentsDir'>): Promise<void>;
|
|
55
55
|
protected onPacket(..._packet: unknown[]): Promise<any>;
|
|
@@ -78,7 +78,7 @@ export declare class BaseClient {
|
|
|
78
78
|
}>;
|
|
79
79
|
}
|
|
80
80
|
export interface BaseClientOptions {
|
|
81
|
-
context?: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ComponentInteraction | ModalSubmitInteraction | EntryPointInteraction<boolean> | When<InferWithPrefix, MessageStructure, never>) =>
|
|
81
|
+
context?: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ComponentInteraction | ModalSubmitInteraction | EntryPointInteraction<boolean> | When<InferWithPrefix, MessageStructure, never>) => object;
|
|
82
82
|
globalMiddlewares?: readonly (keyof RegisteredMiddlewares)[];
|
|
83
83
|
commands?: {
|
|
84
84
|
defaults?: {
|
|
@@ -160,18 +160,13 @@ export interface ServicesOptions {
|
|
|
160
160
|
rest?: ApiHandler;
|
|
161
161
|
cache?: {
|
|
162
162
|
adapter?: Adapter;
|
|
163
|
-
disabledCache?:
|
|
163
|
+
disabledCache?: boolean | Cache['disabledCache'] | ((cacheType: keyof Cache['disabledCache']) => boolean);
|
|
164
164
|
};
|
|
165
165
|
langs?: {
|
|
166
166
|
default?: string;
|
|
167
167
|
aliases?: Record<string, LocaleString[]>;
|
|
168
168
|
};
|
|
169
169
|
middlewares?: Record<string, MiddlewareContext>;
|
|
170
|
-
handlers?: {
|
|
171
|
-
components?: ComponentHandler | ComponentHandler['callback'];
|
|
172
|
-
commands?: CommandHandler;
|
|
173
|
-
langs?: LangsHandler;
|
|
174
|
-
};
|
|
175
170
|
handleCommand?: typeof HandleCommand;
|
|
176
171
|
}
|
|
177
172
|
export {};
|