seyfert 2.0.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 +9 -3
- package/lib/api/Routes/invites.d.ts +3 -4
- package/lib/api/Routes/skus.d.ts +10 -0
- package/lib/api/Routes/skus.js +2 -0
- 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 +26 -22
- package/lib/api/shared.d.ts +2 -2
- package/lib/api/utils/constants.d.ts +3 -1
- package/lib/api/utils/constants.js +3 -2
- package/lib/builders/ActionRow.d.ts +1 -1
- package/lib/builders/Attachment.d.ts +3 -3
- package/lib/builders/Attachment.js +13 -13
- 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 +12 -12
- package/lib/cache/index.js +48 -39
- 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 +10 -15
- package/lib/client/base.js +48 -44
- package/lib/client/client.d.ts +4 -4
- package/lib/client/client.js +37 -38
- package/lib/client/collectors.js +1 -1
- package/lib/client/httpclient.d.ts +1 -1
- package/lib/client/httpclient.js +2 -2
- package/lib/client/transformers.d.ts +37 -34
- package/lib/client/transformers.js +66 -63
- package/lib/client/workerclient.d.ts +13 -13
- package/lib/client/workerclient.js +182 -65
- 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 +46 -0
- package/lib/commands/applications/entryPoint.js +56 -0
- package/lib/commands/applications/entrycontext.d.ts +40 -0
- package/lib/commands/applications/entrycontext.js +85 -0
- 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 +7 -6
- package/lib/commands/applications/shared.d.ts +5 -2
- package/lib/commands/basecontext.d.ts +1 -1
- package/lib/commands/decorators.d.ts +20 -26
- package/lib/commands/decorators.js +8 -4
- package/lib/commands/handle.d.ts +13 -12
- package/lib/commands/handle.js +133 -65
- package/lib/commands/handler.d.ts +9 -7
- package/lib/commands/handler.js +27 -18
- package/lib/commands/index.d.ts +2 -0
- package/lib/commands/index.js +2 -0
- package/lib/commands/optionresolver.d.ts +4 -4
- package/lib/commands/optionresolver.js +4 -4
- package/lib/common/bot/watcher.d.ts +1 -1
- 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 +14 -6
- package/lib/common/it/utils.js +62 -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 +3 -3
- 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/deps/mixer.js +6 -1
- package/lib/events/handler.d.ts +5 -5
- package/lib/events/handler.js +69 -19
- 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/custom.d.ts +1 -0
- package/lib/events/hooks/custom.js +5 -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/subscriptions.d.ts +35 -0
- package/lib/events/hooks/subscriptions.js +16 -0
- 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 +39 -16
- package/lib/structures/Interaction.js +82 -26
- package/lib/structures/Message.d.ts +4 -10
- package/lib/structures/Message.js +5 -8
- 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 +8 -7
- package/lib/structures/extra/BaseGuild.d.ts +11 -1
- package/lib/structures/extra/BaseGuild.js +27 -0
- 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 +71 -6
- package/lib/types/payloads/_interactions/_applicationCommands/chatInput.d.ts +6 -1
- package/lib/types/payloads/_interactions/applicationCommands.d.ts +41 -6
- package/lib/types/payloads/_interactions/applicationCommands.js +28 -1
- package/lib/types/payloads/_interactions/base.d.ts +1 -1
- package/lib/types/payloads/_interactions/responses.d.ts +74 -2
- package/lib/types/payloads/_interactions/responses.js +4 -0
- package/lib/types/payloads/channel.d.ts +46 -6
- package/lib/types/payloads/channel.js +5 -1
- 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/monetization.d.ts +29 -1
- package/lib/types/payloads/monetization.js +10 -1
- 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 +5 -18
- 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/interactions.d.ts +30 -8
- package/lib/types/rest/monetization.d.ts +22 -1
- 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 +3 -3
- package/lib/types/utils/index.d.ts +27 -7
- package/lib/types/utils/index.js +25 -6
- package/lib/websocket/SharedTypes.d.ts +18 -3
- package/lib/websocket/constants/index.d.ts +3 -2
- package/lib/websocket/constants/index.js +4 -4
- package/lib/websocket/discord/basesocket.d.ts +1 -1
- package/lib/websocket/discord/shard.d.ts +4 -3
- package/lib/websocket/discord/shard.js +47 -24
- package/lib/websocket/discord/sharder.d.ts +9 -6
- package/lib/websocket/discord/sharder.js +92 -17
- package/lib/websocket/discord/shared.d.ts +12 -3
- package/lib/websocket/discord/socket/custom.d.ts +1 -1
- package/lib/websocket/discord/socket/custom.js +70 -40
- package/lib/websocket/discord/worker.d.ts +9 -2
- package/lib/websocket/discord/workermanager.d.ts +42 -16
- package/lib/websocket/discord/workermanager.js +170 -46
- package/lib/websocket/structures/timeout.d.ts +4 -5
- package/lib/websocket/structures/timeout.js +23 -24
- package/package.json +72 -65
- package/lib/cache/resources/threads.d.ts +0 -14
- package/lib/cache/resources/threads.js +0 -32
|
@@ -14,32 +14,34 @@ type COMPONENTS = {
|
|
|
14
14
|
callback: ComponentCallback;
|
|
15
15
|
}[];
|
|
16
16
|
options?: ListenerOptions;
|
|
17
|
-
messageId
|
|
17
|
+
messageId: string;
|
|
18
|
+
channelId: string;
|
|
19
|
+
guildId: string | undefined;
|
|
18
20
|
idle?: NodeJS.Timeout;
|
|
19
21
|
timeout?: NodeJS.Timeout;
|
|
20
22
|
__run: (customId: string | string[] | RegExp, callback: ComponentCallback) => any;
|
|
21
23
|
};
|
|
22
24
|
export type CollectorInteraction = ComponentInteraction | StringSelectMenuInteraction;
|
|
23
25
|
export type ComponentCommands = ComponentCommand | ModalCommand;
|
|
26
|
+
export interface CreateComponentCollectorResult {
|
|
27
|
+
run<T extends CollectorInteraction = CollectorInteraction>(customId: string | string[] | RegExp, callback: ComponentCallback<T>): any;
|
|
28
|
+
stop(reason?: string): any;
|
|
29
|
+
}
|
|
24
30
|
export declare class ComponentHandler extends BaseHandler {
|
|
25
31
|
protected client: UsingClient;
|
|
26
32
|
onFail: OnFailCallback;
|
|
27
33
|
readonly values: Map<string, COMPONENTS>;
|
|
28
34
|
readonly modals: LimitedCollection<string, ModalSubmitCallback>;
|
|
29
35
|
readonly commands: ComponentCommands[];
|
|
30
|
-
|
|
36
|
+
filter: (path: string) => boolean;
|
|
31
37
|
constructor(logger: Logger, client: UsingClient);
|
|
32
|
-
createComponentCollector(messageId: string, options?: ListenerOptions):
|
|
33
|
-
|
|
34
|
-
stop(reason?: string): any;
|
|
35
|
-
};
|
|
36
|
-
onComponent(id: string, interaction: ComponentInteraction): Promise<void>;
|
|
38
|
+
createComponentCollector(messageId: string, channelId: string, guildId: string | undefined, options?: ListenerOptions): CreateComponentCollectorResult;
|
|
39
|
+
onComponent(id: string, interaction: ComponentInteraction): Promise<any>;
|
|
37
40
|
hasComponent(id: string, customId: string): boolean;
|
|
38
41
|
resetTimeouts(id: string): void;
|
|
39
42
|
hasModal(interaction: ModalSubmitInteraction): boolean;
|
|
40
43
|
onModalSubmit(interaction: ModalSubmitInteraction): any;
|
|
41
44
|
deleteValue(id: string, reason?: string): void;
|
|
42
|
-
onMessageDelete(id: string): void;
|
|
43
45
|
stablishDefaults(component: ComponentCommands): void;
|
|
44
46
|
set(instances: (new () => ComponentCommands)[]): void;
|
|
45
47
|
load(componentsDir: string): Promise<void>;
|
|
@@ -10,7 +10,7 @@ class ComponentHandler extends common_1.BaseHandler {
|
|
|
10
10
|
client;
|
|
11
11
|
onFail = err => this.logger.warn('<Client>.components.onFail', err);
|
|
12
12
|
values = new Map();
|
|
13
|
-
// 10 minutes timeout, because discord
|
|
13
|
+
// 10 minutes of timeout by default, because discord doesnt send an event when the user cancels the modal
|
|
14
14
|
modals = new collection_1.LimitedCollection({ expire: 60e3 * 10 });
|
|
15
15
|
commands = [];
|
|
16
16
|
filter = (path) => path.endsWith('.js') || (!path.endsWith('.d.ts') && path.endsWith('.ts'));
|
|
@@ -18,15 +18,18 @@ class ComponentHandler extends common_1.BaseHandler {
|
|
|
18
18
|
super(logger);
|
|
19
19
|
this.client = client;
|
|
20
20
|
}
|
|
21
|
-
createComponentCollector(messageId, options = {}) {
|
|
21
|
+
createComponentCollector(messageId, channelId, guildId, options = {}) {
|
|
22
22
|
this.values.set(messageId, {
|
|
23
|
-
|
|
23
|
+
messageId,
|
|
24
|
+
channelId,
|
|
25
|
+
guildId,
|
|
24
26
|
options,
|
|
27
|
+
components: [],
|
|
25
28
|
idle: options.idle && options.idle > 0
|
|
26
29
|
? setTimeout(() => {
|
|
27
30
|
this.deleteValue(messageId);
|
|
28
31
|
options.onStop?.('idle', () => {
|
|
29
|
-
this.createComponentCollector(messageId, options);
|
|
32
|
+
this.createComponentCollector(messageId, channelId, guildId, options);
|
|
30
33
|
});
|
|
31
34
|
}, options.idle)
|
|
32
35
|
: undefined,
|
|
@@ -34,7 +37,7 @@ class ComponentHandler extends common_1.BaseHandler {
|
|
|
34
37
|
? setTimeout(() => {
|
|
35
38
|
this.deleteValue(messageId);
|
|
36
39
|
options.onStop?.('timeout', () => {
|
|
37
|
-
this.createComponentCollector(messageId, options);
|
|
40
|
+
this.createComponentCollector(messageId, channelId, guildId, options);
|
|
38
41
|
});
|
|
39
42
|
}, options.timeout)
|
|
40
43
|
: undefined,
|
|
@@ -53,7 +56,7 @@ class ComponentHandler extends common_1.BaseHandler {
|
|
|
53
56
|
stop: (reason) => {
|
|
54
57
|
this.deleteValue(messageId);
|
|
55
58
|
options.onStop?.(reason, () => {
|
|
56
|
-
this.createComponentCollector(messageId, options);
|
|
59
|
+
this.createComponentCollector(messageId, channelId, guildId, options);
|
|
57
60
|
});
|
|
58
61
|
},
|
|
59
62
|
};
|
|
@@ -71,11 +74,13 @@ class ComponentHandler extends common_1.BaseHandler {
|
|
|
71
74
|
return;
|
|
72
75
|
if (row.options?.filter) {
|
|
73
76
|
if (!(await row.options.filter(interaction)))
|
|
74
|
-
return;
|
|
77
|
+
return row.options.onPass?.(interaction);
|
|
75
78
|
}
|
|
76
79
|
row.idle?.refresh();
|
|
77
80
|
await component.callback(interaction, reason => {
|
|
78
|
-
row.options?.onStop?.(reason ?? 'stop')
|
|
81
|
+
row.options?.onStop?.(reason ?? 'stop', () => {
|
|
82
|
+
this.createComponentCollector(row.messageId, row.channelId, row.guildId, row.options);
|
|
83
|
+
});
|
|
79
84
|
this.deleteValue(id);
|
|
80
85
|
}, () => {
|
|
81
86
|
this.resetTimeouts(id);
|
|
@@ -107,16 +112,14 @@ class ComponentHandler extends common_1.BaseHandler {
|
|
|
107
112
|
deleteValue(id, reason) {
|
|
108
113
|
const component = this.values.get(id);
|
|
109
114
|
if (component) {
|
|
110
|
-
|
|
111
|
-
component.options
|
|
115
|
+
component.options?.onStop?.(reason, () => {
|
|
116
|
+
this.createComponentCollector(component.messageId, component.channelId, component.guildId, component.options);
|
|
117
|
+
});
|
|
112
118
|
clearTimeout(component.timeout);
|
|
113
119
|
clearTimeout(component.idle);
|
|
114
120
|
this.values.delete(id);
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
|
-
onMessageDelete(id) {
|
|
118
|
-
this.deleteValue(id, 'messageDelete');
|
|
119
|
-
}
|
|
120
123
|
stablishDefaults(component) {
|
|
121
124
|
component.props ??= this.client.options.commands?.defaults?.props ?? {};
|
|
122
125
|
const is = component instanceof modalcommand_1.ModalCommand ? 'modals' : 'components';
|
package/lib/components/index.js
CHANGED
|
@@ -35,7 +35,7 @@ __exportStar(require("./modalcontext"), exports);
|
|
|
35
35
|
*/
|
|
36
36
|
function componentFactory(component) {
|
|
37
37
|
switch (component.type) {
|
|
38
|
-
case types_1.ComponentType.Button:
|
|
38
|
+
case types_1.ComponentType.Button: {
|
|
39
39
|
if (component.style === types_1.ButtonStyle.Link) {
|
|
40
40
|
return new ButtonComponent_1.LinkButtonComponent(component);
|
|
41
41
|
}
|
|
@@ -43,6 +43,7 @@ function componentFactory(component) {
|
|
|
43
43
|
return new ButtonComponent_1.SKUButtonComponent(component);
|
|
44
44
|
}
|
|
45
45
|
return new ButtonComponent_1.ButtonComponent(component);
|
|
46
|
+
}
|
|
46
47
|
case types_1.ComponentType.ChannelSelect:
|
|
47
48
|
return new ChannelSelectMenuComponent_1.ChannelSelectMenuComponent(component);
|
|
48
49
|
case types_1.ComponentType.RoleSelect:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AllChannels, ModalCommand, ModalSubmitInteraction, ReturnCache } from '..';
|
|
2
|
+
import type { GuildMemberStructure, GuildStructure, MessageStructure, WebhookMessageStructure } from '../client/transformers';
|
|
2
3
|
import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands';
|
|
3
4
|
import { BaseContext } from '../commands/basecontext';
|
|
4
5
|
import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, ModalCreateBodyRequest, UnionToTuple, When } from '../common';
|
|
5
|
-
import type { GuildMemberStructure, GuildStructure, MessageStructure, WebhookMessageStructure } from '../client/transformers';
|
|
6
6
|
export interface ModalContext extends BaseContext, ExtendContext {
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -46,7 +46,7 @@ export declare class ModalContext<M extends keyof RegisteredMiddlewares = never>
|
|
|
46
46
|
* Defers the reply to the interaction.
|
|
47
47
|
* @param ephemeral - Whether the reply should be ephemeral or not.
|
|
48
48
|
*/
|
|
49
|
-
deferReply(ephemeral?: boolean): Promise<
|
|
49
|
+
deferReply(ephemeral?: boolean): Promise<undefined>;
|
|
50
50
|
/**
|
|
51
51
|
* Edits the response of the interaction.
|
|
52
52
|
* @param body - The updated body of the response.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ModalContext = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
4
|
const basecontext_1 = require("../commands/basecontext");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
6
|
/**
|
|
7
7
|
* Represents a context for interacting with components in a Discord bot.
|
|
8
8
|
* @template Type - The type of component interaction.
|
package/lib/deps/mixer.d.ts
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* @returns The mixed class.
|
|
5
5
|
*/
|
|
6
6
|
export declare function Mixin<T, C extends TypeClass[]>(...args: C): C[number] & T;
|
|
7
|
-
export type TypeClass<InstanceType =
|
|
7
|
+
export type TypeClass<InstanceType = object, StaticType = object> = (abstract new (...args: any[]) => InstanceType) & StaticType;
|
|
8
8
|
export declare const mix: (...ingredients: TypeClass[]) => (decoratedClass: any) => any;
|
package/lib/deps/mixer.js
CHANGED
|
@@ -26,6 +26,7 @@ function getDescriptors(c) {
|
|
|
26
26
|
* @returns The mixed class.
|
|
27
27
|
*/
|
|
28
28
|
function Mixin(...args) {
|
|
29
|
+
const ignoreOverwriteToString = Object.keys(Object.getOwnPropertyDescriptors(args[0].prototype)).includes('toString');
|
|
29
30
|
function MixedClass(...constructorArgs) {
|
|
30
31
|
for (const i of args) {
|
|
31
32
|
const descriptors = getDescriptors(i);
|
|
@@ -35,10 +36,14 @@ function Mixin(...args) {
|
|
|
35
36
|
for (const descriptorK in j) {
|
|
36
37
|
if (descriptorK === 'constructor')
|
|
37
38
|
continue;
|
|
38
|
-
if (descriptorK in MixedClass.prototype)
|
|
39
|
+
if (descriptorK in MixedClass.prototype && descriptorK !== 'toString')
|
|
39
40
|
continue;
|
|
40
41
|
const descriptor = j[descriptorK];
|
|
41
42
|
if (descriptor.value) {
|
|
43
|
+
if (descriptorK === 'toString' && ignoreOverwriteToString) {
|
|
44
|
+
MixedClass.prototype[descriptorK] = args[0].prototype.toString;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
42
47
|
MixedClass.prototype[descriptorK] = descriptor.value;
|
|
43
48
|
continue;
|
|
44
49
|
}
|
package/lib/events/handler.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { GatewayDispatchPayload } from '../types';
|
|
2
1
|
import type { Client, WorkerClient } from '../client';
|
|
2
|
+
import type { UsingClient } from '../commands';
|
|
3
|
+
import type { FileLoaded } from '../commands/handler';
|
|
3
4
|
import { BaseHandler, type CamelCase, type MakeRequired, type SnakeCase } from '../common';
|
|
4
5
|
import type { ClientEvents } from '../events/hooks';
|
|
5
|
-
import
|
|
6
|
-
import type {
|
|
7
|
-
import type { UsingClient } from '../commands';
|
|
6
|
+
import { type GatewayDispatchPayload } from '../types';
|
|
7
|
+
import type { ClientEvent, ClientNameEvents, CustomEvents, CustomEventsKeys, EventContext } from './event';
|
|
8
8
|
export type EventValue = MakeRequired<ClientEvent, '__filePath'> & {
|
|
9
9
|
fired?: boolean;
|
|
10
10
|
};
|
|
@@ -36,7 +36,7 @@ export declare class EventHandler extends BaseHandler {
|
|
|
36
36
|
protected client: Client | WorkerClient;
|
|
37
37
|
constructor(client: Client | WorkerClient);
|
|
38
38
|
onFail: (event: GatewayEvents | CustomEventsKeys, err: unknown) => void;
|
|
39
|
-
|
|
39
|
+
filter: (path: string) => boolean;
|
|
40
40
|
values: Partial<EventValues>;
|
|
41
41
|
discordEvents: ClientNameEvents[];
|
|
42
42
|
set(events: ClientEvent[]): void;
|
package/lib/events/handler.js
CHANGED
|
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.EventHandler = void 0;
|
|
27
27
|
const common_1 = require("../common");
|
|
28
28
|
const RawEvents = __importStar(require("../events/hooks"));
|
|
29
|
+
const types_1 = require("../types");
|
|
29
30
|
class EventHandler extends common_1.BaseHandler {
|
|
30
31
|
client;
|
|
31
32
|
constructor(client) {
|
|
@@ -72,33 +73,82 @@ class EventHandler extends common_1.BaseHandler {
|
|
|
72
73
|
}
|
|
73
74
|
async execute(name, ...args) {
|
|
74
75
|
switch (name) {
|
|
75
|
-
case 'MESSAGE_CREATE':
|
|
76
|
-
{
|
|
77
|
-
const { d: data } = args[0];
|
|
78
|
-
if (args[1].components?.values.has(data.interaction_metadata?.id ?? data.id)) {
|
|
79
|
-
args[1].components.values.get(data.interaction_metadata.id ?? data.id).messageId = data.id;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
break;
|
|
83
76
|
case 'MESSAGE_DELETE':
|
|
84
77
|
{
|
|
78
|
+
if (!args[1].components?.values.size)
|
|
79
|
+
break;
|
|
85
80
|
const { d: data } = args[0];
|
|
86
|
-
const value =
|
|
81
|
+
const value = args[1].components.values.get(data.id);
|
|
87
82
|
if (value) {
|
|
88
|
-
args[1].components.
|
|
83
|
+
args[1].components.deleteValue(value.messageId, 'messageDelete');
|
|
89
84
|
}
|
|
90
85
|
}
|
|
91
86
|
break;
|
|
92
87
|
case 'MESSAGE_DELETE_BULK':
|
|
93
88
|
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
if (!args[1].components?.values.size)
|
|
90
|
+
break;
|
|
91
|
+
const { d: payload } = args[0];
|
|
92
|
+
for (const id of payload.ids) {
|
|
93
|
+
const value = args[1].components.values.get(id);
|
|
98
94
|
if (value) {
|
|
99
|
-
args[1].components.
|
|
95
|
+
args[1].components.deleteValue(value.messageId, 'messageDelete');
|
|
100
96
|
}
|
|
101
|
-
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case 'GUILD_DELETE':
|
|
101
|
+
{
|
|
102
|
+
if (!args[1].components?.values.size)
|
|
103
|
+
break;
|
|
104
|
+
const { d: payload } = args[0];
|
|
105
|
+
// ignore unavailable guilds?
|
|
106
|
+
if (payload.unavailable)
|
|
107
|
+
break;
|
|
108
|
+
for (const [messageId, value] of args[1].components.values) {
|
|
109
|
+
if (value.guildId === payload.id)
|
|
110
|
+
args[1].components.deleteValue(messageId, 'guildDelete');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
case 'CHANNEL_DELETE':
|
|
115
|
+
{
|
|
116
|
+
if (!args[1].components?.values.size)
|
|
117
|
+
break;
|
|
118
|
+
const { d: payload } = args[0];
|
|
119
|
+
if (payload.type === types_1.ChannelType.DM || payload.type === types_1.ChannelType.GroupDM) {
|
|
120
|
+
for (const value of args[1].components.values) {
|
|
121
|
+
if (payload.id === value[1].channelId)
|
|
122
|
+
args[1].components.deleteValue(value[0], 'channelDelete');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
if (!payload.guild_id)
|
|
127
|
+
break;
|
|
128
|
+
// this is why we dont recommend to use collectors, use ComponentCommand instead
|
|
129
|
+
const channels = await args[1].cache.channels?.valuesRaw(payload.guild_id);
|
|
130
|
+
const threads = channels
|
|
131
|
+
?.filter(x => [types_1.ChannelType.PublicThread, types_1.ChannelType.PrivateThread, types_1.ChannelType.AnnouncementThread].includes(x.type) && x.parent_id === payload.id)
|
|
132
|
+
.map(x => x.id);
|
|
133
|
+
for (const value of args[1].components.values) {
|
|
134
|
+
const channelId = value[1].channelId;
|
|
135
|
+
if (payload.id === channelId || threads?.includes(channelId)) {
|
|
136
|
+
args[1].components.deleteValue(value[0], 'channelDelete');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
break;
|
|
142
|
+
case 'THREAD_DELETE':
|
|
143
|
+
{
|
|
144
|
+
if (!args[1].components?.values.size)
|
|
145
|
+
break;
|
|
146
|
+
const { d: payload } = args[0];
|
|
147
|
+
for (const value of args[1].components.values) {
|
|
148
|
+
if (value[1].channelId === payload.id) {
|
|
149
|
+
args[1].components.deleteValue(value[0], 'channelDelete');
|
|
150
|
+
}
|
|
151
|
+
}
|
|
102
152
|
}
|
|
103
153
|
break;
|
|
104
154
|
}
|
|
@@ -111,7 +161,7 @@ class EventHandler extends common_1.BaseHandler {
|
|
|
111
161
|
const Event = this.values[name];
|
|
112
162
|
if (!Event) {
|
|
113
163
|
return runCache
|
|
114
|
-
? this.client.cache.onPacket
|
|
164
|
+
? this.client.cache.onPacket({
|
|
115
165
|
t: name,
|
|
116
166
|
d: packet,
|
|
117
167
|
})
|
|
@@ -120,7 +170,7 @@ class EventHandler extends common_1.BaseHandler {
|
|
|
120
170
|
try {
|
|
121
171
|
if (Event.data.once && Event.fired) {
|
|
122
172
|
return runCache
|
|
123
|
-
? this.client.cache.onPacket
|
|
173
|
+
? this.client.cache.onPacket({
|
|
124
174
|
t: name,
|
|
125
175
|
d: packet,
|
|
126
176
|
})
|
|
@@ -129,7 +179,7 @@ class EventHandler extends common_1.BaseHandler {
|
|
|
129
179
|
Event.fired = true;
|
|
130
180
|
const hook = await RawEvents[name]?.(client, packet);
|
|
131
181
|
if (runCache)
|
|
132
|
-
await this.client.cache.onPacket
|
|
182
|
+
await this.client.cache.onPacket({
|
|
133
183
|
t: name,
|
|
134
184
|
d: packet,
|
|
135
185
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from '../../types';
|
|
2
1
|
import type { UsingClient } from '../../commands';
|
|
2
|
+
import type { GatewayApplicationCommandPermissionsUpdateDispatchData } from '../../types';
|
|
3
3
|
export declare const APPLICATION_COMMAND_PERMISSIONS_UPDATE: (_self: UsingClient, data: GatewayApplicationCommandPermissionsUpdateDispatchData) => {
|
|
4
4
|
id: string;
|
|
5
5
|
applicationId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GatewayAutoModerationActionExecutionDispatchData, GatewayAutoModerationRuleCreateDispatchData, GatewayAutoModerationRuleDeleteDispatchData, GatewayAutoModerationRuleUpdateDispatchData } from '../../types';
|
|
2
1
|
import type { UsingClient } from '../../commands';
|
|
2
|
+
import type { GatewayAutoModerationActionExecutionDispatchData, GatewayAutoModerationRuleCreateDispatchData, GatewayAutoModerationRuleDeleteDispatchData, GatewayAutoModerationRuleUpdateDispatchData } from '../../types';
|
|
3
3
|
export declare const AUTO_MODERATION_ACTION_EXECUTION: (_self: UsingClient, data: GatewayAutoModerationActionExecutionDispatchData) => {
|
|
4
4
|
guildId: string;
|
|
5
5
|
action: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AUTO_MODERATION_RULE_UPDATE = exports.AUTO_MODERATION_RULE_DELETE = exports.AUTO_MODERATION_RULE_CREATE = exports.AUTO_MODERATION_ACTION_EXECUTION = void 0;
|
|
4
|
-
const common_1 = require("../../common");
|
|
5
4
|
const transformers_1 = require("../../client/transformers");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
6
|
const AUTO_MODERATION_ACTION_EXECUTION = (_self, data) => {
|
|
7
7
|
return (0, common_1.toCamelCase)(data);
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GatewayChannelCreateDispatchData, GatewayChannelDeleteDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayChannelUpdateDispatchData } from '../../types';
|
|
2
|
-
import { type AllChannels } from '../../structures';
|
|
3
2
|
import type { UsingClient } from '../../commands';
|
|
3
|
+
import { type AllChannels } from '../../structures';
|
|
4
4
|
export declare const CHANNEL_CREATE: (self: UsingClient, data: GatewayChannelCreateDispatchData) => AllChannels;
|
|
5
5
|
export declare const CHANNEL_DELETE: (self: UsingClient, data: GatewayChannelDeleteDispatchData) => AllChannels;
|
|
6
6
|
export declare const CHANNEL_PINS_UPDATE: (_self: UsingClient, data: GatewayChannelPinsUpdateDispatchData) => {
|
|
@@ -2,3 +2,4 @@ import type { ClientUserStructure } from '../../client/transformers';
|
|
|
2
2
|
import type { UsingClient } from '../../commands';
|
|
3
3
|
export declare const BOT_READY: (_self: UsingClient, me: ClientUserStructure) => import("../..").ClientUser;
|
|
4
4
|
export declare const WORKER_READY: (_self: UsingClient, me: ClientUserStructure) => import("../..").ClientUser;
|
|
5
|
+
export declare const WORKER_SHARDS_CONNECTED: (_self: UsingClient, me: ClientUserStructure) => import("../..").ClientUser;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WORKER_READY = exports.BOT_READY = void 0;
|
|
3
|
+
exports.WORKER_SHARDS_CONNECTED = exports.WORKER_READY = exports.BOT_READY = void 0;
|
|
4
4
|
const BOT_READY = (_self, me) => {
|
|
5
5
|
return me;
|
|
6
6
|
};
|
|
@@ -9,3 +9,7 @@ const WORKER_READY = (_self, me) => {
|
|
|
9
9
|
return me;
|
|
10
10
|
};
|
|
11
11
|
exports.WORKER_READY = WORKER_READY;
|
|
12
|
+
const WORKER_SHARDS_CONNECTED = (_self, me) => {
|
|
13
|
+
return me;
|
|
14
|
+
};
|
|
15
|
+
exports.WORKER_SHARDS_CONNECTED = WORKER_SHARDS_CONNECTED;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GatewayDispatchPayload, GatewayReadyDispatchData, GatewayResumedDispatch } from '../../types';
|
|
2
1
|
import type { UsingClient } from '../../commands';
|
|
2
|
+
import type { GatewayDispatchPayload, GatewayReadyDispatchData, GatewayResumedDispatch } from '../../types';
|
|
3
3
|
export declare const READY: (self: UsingClient, data: GatewayReadyDispatchData) => import("../..").ClientUser;
|
|
4
4
|
export declare const RESUMED: (_self: UsingClient, _data: GatewayResumedDispatch["d"]) => void;
|
|
5
5
|
export declare const RAW: (_self: UsingClient, data: GatewayDispatchPayload) => GatewayDispatchPayload;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { APIEntitlement } from '../../types';
|
|
2
1
|
import type { UsingClient } from '../../commands';
|
|
3
|
-
import {
|
|
4
|
-
export declare const ENTITLEMENT_CREATE: (client: UsingClient, data: APIEntitlement) => Entitlement;
|
|
5
|
-
export declare const ENTITLEMENT_UPDATE: (client: UsingClient, data: APIEntitlement) => Entitlement;
|
|
6
|
-
export declare const ENTITLEMENT_DELETE: (client: UsingClient, data: APIEntitlement) => Entitlement;
|
|
2
|
+
import type { APIEntitlement } from '../../types';
|
|
3
|
+
export declare const ENTITLEMENT_CREATE: (client: UsingClient, data: APIEntitlement) => import("../../structures/Entitlement").Entitlement;
|
|
4
|
+
export declare const ENTITLEMENT_UPDATE: (client: UsingClient, data: APIEntitlement) => import("../../structures/Entitlement").Entitlement;
|
|
5
|
+
export declare const ENTITLEMENT_DELETE: (client: UsingClient, data: APIEntitlement) => import("../../structures/Entitlement").Entitlement;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ENTITLEMENT_DELETE = exports.ENTITLEMENT_UPDATE = exports.ENTITLEMENT_CREATE = void 0;
|
|
4
|
-
const
|
|
4
|
+
const client_1 = require("../../client");
|
|
5
5
|
const ENTITLEMENT_CREATE = (client, data) => {
|
|
6
|
-
return
|
|
6
|
+
return client_1.Transformers.Entitlement(client, data);
|
|
7
7
|
};
|
|
8
8
|
exports.ENTITLEMENT_CREATE = ENTITLEMENT_CREATE;
|
|
9
9
|
const ENTITLEMENT_UPDATE = (client, data) => {
|
|
10
|
-
return
|
|
10
|
+
return client_1.Transformers.Entitlement(client, data);
|
|
11
11
|
};
|
|
12
12
|
exports.ENTITLEMENT_UPDATE = ENTITLEMENT_UPDATE;
|
|
13
13
|
const ENTITLEMENT_DELETE = (client, data) => {
|
|
14
|
-
return
|
|
14
|
+
return client_1.Transformers.Entitlement(client, data);
|
|
15
15
|
};
|
|
16
16
|
exports.ENTITLEMENT_DELETE = ENTITLEMENT_DELETE;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { GatewayGuildAuditLogEntryCreateDispatchData, GatewayGuildBanAddDispatchData, GatewayGuildBanRemoveDispatchData, GatewayGuildCreateDispatchData, GatewayGuildDeleteDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberAddDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberUpdateDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleCreateDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildRoleUpdateDispatchData, GatewayGuildScheduledEventCreateDispatchData, GatewayGuildScheduledEventDeleteDispatchData, GatewayGuildScheduledEventUpdateDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData } from '../../types';
|
|
2
|
-
import type { UsingClient } from '../../commands';
|
|
3
1
|
import { type GuildMemberStructure, type GuildRoleStructure, type GuildStructure } from '../../client/transformers';
|
|
2
|
+
import type { UsingClient } from '../../commands';
|
|
3
|
+
import type { GatewayGuildAuditLogEntryCreateDispatchData, GatewayGuildBanAddDispatchData, GatewayGuildBanRemoveDispatchData, GatewayGuildCreateDispatchData, GatewayGuildDeleteDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberAddDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberUpdateDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleCreateDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildRoleUpdateDispatchData, GatewayGuildScheduledEventCreateDispatchData, GatewayGuildScheduledEventDeleteDispatchData, GatewayGuildScheduledEventUpdateDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData } from '../../types';
|
|
4
4
|
export declare const GUILD_AUDIT_LOG_ENTRY_CREATE: (_self: UsingClient, data: GatewayGuildAuditLogEntryCreateDispatchData) => {
|
|
5
5
|
guildId: string;
|
|
6
6
|
targetId: string | null;
|
|
@@ -500,8 +500,8 @@ export declare const GUILD_MEMBERS_CHUNK: (self: UsingClient, data: GatewayGuild
|
|
|
500
500
|
smallText?: string | undefined;
|
|
501
501
|
} | undefined;
|
|
502
502
|
secrets?: {
|
|
503
|
-
match?: string | undefined;
|
|
504
503
|
join?: string | undefined;
|
|
504
|
+
match?: string | undefined;
|
|
505
505
|
spectate?: string | undefined;
|
|
506
506
|
} | undefined;
|
|
507
507
|
instance?: boolean | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GUILD_UPDATE = exports.GUILD_STICKERS_UPDATE = exports.GUILD_ROLE_UPDATE = exports.GUILD_ROLE_DELETE = exports.GUILD_ROLE_CREATE = exports.GUILD_SCHEDULED_EVENT_USER_REMOVE = exports.GUILD_SCHEDULED_EVENT_USER_ADD = exports.GUILD_SCHEDULED_EVENT_DELETE = exports.GUILD_SCHEDULED_EVENT_UPDATE = exports.GUILD_SCHEDULED_EVENT_CREATE = exports.GUILD_MEMBER_UPDATE = exports.GUILD_MEMBERS_CHUNK = exports.GUILD_MEMBER_REMOVE = exports.GUILD_MEMBER_ADD = exports.GUILD_INTEGRATIONS_UPDATE = exports.GUILD_EMOJIS_UPDATE = exports.GUILD_DELETE = exports.GUILD_CREATE = exports.GUILD_BAN_REMOVE = exports.GUILD_BAN_ADD = exports.GUILD_AUDIT_LOG_ENTRY_CREATE = void 0;
|
|
4
|
-
const common_1 = require("../../common");
|
|
5
4
|
const transformers_1 = require("../../client/transformers");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
6
|
const GUILD_AUDIT_LOG_ENTRY_CREATE = (_self, data) => {
|
|
7
7
|
return (0, common_1.toCamelCase)(data);
|
|
8
8
|
};
|
|
@@ -16,6 +16,7 @@ export * from './typing';
|
|
|
16
16
|
export * from './user';
|
|
17
17
|
export * from './voice';
|
|
18
18
|
export * from './webhook';
|
|
19
|
+
export * from './soundboard';
|
|
19
20
|
import type { CamelCase } from '../../common';
|
|
20
21
|
import type * as RawEvents from './index';
|
|
21
22
|
export type ClientEvents = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData } from '../../types';
|
|
2
1
|
import type { UsingClient } from '../../commands';
|
|
2
|
+
import type { GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData } from '../../types';
|
|
3
3
|
export declare const INTEGRATION_CREATE: (self: UsingClient, data: GatewayIntegrationCreateDispatchData) => {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.INTEGRATION_DELETE = exports.INTEGRATION_UPDATE = exports.INTEGRATION_CREATE = void 0;
|
|
4
|
-
const common_1 = require("../../common");
|
|
5
4
|
const transformers_1 = require("../../client/transformers");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
6
|
const INTEGRATION_CREATE = (self, data) => {
|
|
7
7
|
return data.user
|
|
8
8
|
? {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GatewayInteractionCreateDispatchData } from '../../types';
|
|
2
|
-
import { BaseInteraction } from '../../structures';
|
|
3
1
|
import type { UsingClient } from '../../commands';
|
|
4
|
-
|
|
2
|
+
import { BaseInteraction } from '../../structures';
|
|
3
|
+
import type { GatewayInteractionCreateDispatchData } from '../../types';
|
|
4
|
+
export declare const INTERACTION_CREATE: (self: UsingClient, data: GatewayInteractionCreateDispatchData) => import("../../structures").RoleSelectMenuInteraction | import("../../structures").UserSelectMenuInteraction | import("../../structures").MentionableSelectMenuInteraction | import("../../structures").ChannelSelectMenuInteraction | import("../../structures").StringSelectMenuInteraction<string[]> | import("../../structures").ChatInputCommandInteraction<boolean> | import("../../structures").UserCommandInteraction<boolean> | import("../../structures").MessageCommandInteraction<boolean> | import("../../structures").ButtonInteraction | import("../../structures").ModalSubmitInteraction<boolean> | import("../../structures").AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../../types").APIPingInteraction>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData } from '../../types';
|
|
2
1
|
import type { UsingClient } from '../../commands';
|
|
2
|
+
import type { GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData } from '../../types';
|
|
3
3
|
export declare const INVITE_CREATE: (_self: UsingClient, data: GatewayInviteCreateDispatchData) => {
|
|
4
4
|
channelId: string;
|
|
5
5
|
code: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { GatewayMessageCreateDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageDeleteDispatchData, GatewayMessagePollVoteDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData } from '../../types';
|
|
2
|
-
import { type OmitInsert, type ObjectToLower } from '../../common';
|
|
3
|
-
import type { UsingClient } from '../../commands';
|
|
4
1
|
import { type MessageStructure } from '../../client/transformers';
|
|
2
|
+
import type { UsingClient } from '../../commands';
|
|
3
|
+
import { type ObjectToLower, type OmitInsert } from '../../common';
|
|
4
|
+
import type { GatewayMessageCreateDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageDeleteDispatchData, GatewayMessagePollVoteDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData } from '../../types';
|
|
5
5
|
export declare const MESSAGE_CREATE: (self: UsingClient, data: GatewayMessageCreateDispatchData) => import("../..").Message;
|
|
6
6
|
export declare const MESSAGE_DELETE: (self: UsingClient, data: GatewayMessageDeleteDispatchData) => Promise<MessageStructure | ObjectToLower<GatewayMessageDeleteDispatchData>>;
|
|
7
7
|
export declare const MESSAGE_DELETE_BULK: (self: UsingClient, data: GatewayMessageDeleteBulkDispatchData) => Promise<{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MESSAGE_POLL_VOTE_REMOVE = exports.MESSAGE_UPDATE = exports.MESSAGE_REACTION_REMOVE_EMOJI = exports.MESSAGE_REACTION_REMOVE_ALL = exports.MESSAGE_REACTION_REMOVE = exports.MESSAGE_REACTION_ADD = exports.MESSAGE_DELETE_BULK = exports.MESSAGE_DELETE = exports.MESSAGE_CREATE = void 0;
|
|
4
|
-
const common_1 = require("../../common");
|
|
5
4
|
const transformers_1 = require("../../client/transformers");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
6
|
const MESSAGE_CREATE = (self, data) => {
|
|
7
7
|
return transformers_1.Transformers.Message(self, data);
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GatewayPresenceUpdateDispatchData } from '../../types';
|
|
2
1
|
import type { UsingClient } from '../../commands';
|
|
2
|
+
import type { GatewayPresenceUpdateDispatchData } from '../../types';
|
|
3
3
|
export declare const PRESENCE_UPDATE: (self: UsingClient, data: GatewayPresenceUpdateDispatchData) => Promise<readonly [{
|
|
4
4
|
user: {
|
|
5
5
|
id: string;
|
|
@@ -58,8 +58,8 @@ export declare const PRESENCE_UPDATE: (self: UsingClient, data: GatewayPresenceU
|
|
|
58
58
|
smallText?: string | undefined;
|
|
59
59
|
} | undefined;
|
|
60
60
|
secrets?: {
|
|
61
|
-
match?: string | undefined;
|
|
62
61
|
join?: string | undefined;
|
|
62
|
+
match?: string | undefined;
|
|
63
63
|
spectate?: string | undefined;
|
|
64
64
|
} | undefined;
|
|
65
65
|
instance?: boolean | undefined;
|