seyfert 1.1.1 → 1.2.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/Routes/applications.d.ts +2 -2
- package/lib/api/Routes/channels.d.ts +2 -2
- package/lib/api/Routes/gateway.d.ts +2 -2
- package/lib/api/Routes/guilds.d.ts +2 -1
- package/lib/api/Routes/interactions.d.ts +2 -2
- package/lib/api/Routes/invites.d.ts +2 -2
- package/lib/api/Routes/stage-instances.d.ts +2 -2
- package/lib/api/Routes/stickers.d.ts +2 -2
- package/lib/api/Routes/users.d.ts +2 -2
- package/lib/api/Routes/voice.d.ts +2 -2
- package/lib/api/Routes/webhooks.d.ts +2 -2
- package/lib/builders/ActionRow.d.ts +2 -1
- package/lib/builders/ActionRow.js +3 -3
- package/lib/builders/Base.d.ts +1 -1
- package/lib/builders/Button.d.ts +2 -1
- package/lib/builders/Button.js +2 -2
- package/lib/builders/Embed.d.ts +2 -1
- package/lib/builders/Modal.d.ts +9 -2
- package/lib/builders/Modal.js +12 -3
- package/lib/builders/SelectMenu.d.ts +18 -1
- package/lib/builders/SelectMenu.js +36 -12
- package/lib/builders/index.d.ts +1 -1
- package/lib/builders/index.js +9 -9
- package/lib/builders/types.d.ts +1 -1
- package/lib/cache/index.d.ts +5 -5
- package/lib/cache/index.js +3 -3
- package/lib/cache/resources/default/base.d.ts +1 -1
- package/lib/cache/resources/default/guild-based.d.ts +1 -1
- package/lib/cache/resources/default/guild-related.d.ts +1 -1
- package/lib/cache/resources/presence.d.ts +1 -1
- package/lib/cache/resources/stage-instances.d.ts +1 -1
- package/lib/cache/resources/voice-states.d.ts +1 -1
- package/lib/client/base.d.ts +4 -3
- package/lib/client/client.d.ts +2 -1
- package/lib/client/client.js +2 -2
- package/lib/client/httpclient.d.ts +2 -1
- package/lib/client/httpclient.js +3 -3
- package/lib/client/oninteractioncreate.js +11 -12
- package/lib/client/onmessagecreate.js +2 -3
- package/lib/client/workerclient.d.ts +3 -2
- package/lib/client/workerclient.js +4 -3
- package/lib/commands/applications/chat.d.ts +3 -3
- package/lib/commands/applications/chat.js +4 -3
- package/lib/commands/applications/chatcontext.d.ts +6 -9
- package/lib/commands/applications/chatcontext.js +6 -17
- package/lib/commands/applications/menu.d.ts +2 -1
- package/lib/commands/applications/menucontext.d.ts +4 -8
- package/lib/commands/applications/menucontext.js +7 -20
- package/lib/commands/basecontex.d.ts +15 -0
- package/lib/commands/basecontex.js +34 -0
- package/lib/commands/decorators.d.ts +2 -1
- package/lib/commands/decorators.js +4 -4
- package/lib/commands/handler.js +4 -3
- package/lib/commands/optionresolver.d.ts +3 -3
- package/lib/commands/optionresolver.js +14 -14
- package/lib/common/index.d.ts +0 -1
- package/lib/common/index.js +0 -1
- package/lib/common/it/constants.d.ts +3 -1
- package/lib/common/it/constants.js +2 -0
- package/lib/common/shorters/channels.d.ts +1 -1
- package/lib/common/shorters/channels.js +4 -4
- package/lib/common/shorters/guilds.d.ts +1 -1
- package/lib/common/shorters/guilds.js +6 -1
- package/lib/common/shorters/members.d.ts +6 -1
- package/lib/common/shorters/members.js +25 -2
- package/lib/common/shorters/webhook.d.ts +2 -2
- package/lib/common/types/resolvables.d.ts +2 -1
- package/lib/common/types/util.d.ts +1 -1
- package/lib/common/types/write.d.ts +1 -1
- package/lib/components/ActionRow.d.ts +4 -3
- package/lib/components/ActionRow.js +6 -3
- package/lib/components/BaseComponent.d.ts +18 -0
- package/lib/components/BaseComponent.js +21 -0
- package/lib/components/BaseSelectMenuComponent.d.ts +10 -0
- package/lib/components/BaseSelectMenuComponent.js +22 -0
- package/lib/components/ButtonComponent.d.ts +14 -14
- package/lib/components/ButtonComponent.js +36 -25
- package/lib/components/ChannelSelectMenuComponent.d.ts +4 -4
- package/lib/components/ChannelSelectMenuComponent.js +6 -5
- package/lib/components/MentionableSelectMenuComponent.d.ts +3 -2
- package/lib/components/MentionableSelectMenuComponent.js +4 -1
- package/lib/components/RoleSelectMenuComponent.d.ts +3 -2
- package/lib/components/RoleSelectMenuComponent.js +4 -1
- package/lib/components/StringSelectMenuComponent.d.ts +3 -4
- package/lib/components/StringSelectMenuComponent.js +3 -5
- package/lib/components/TextInputComponent.d.ts +10 -5
- package/lib/components/TextInputComponent.js +24 -7
- package/lib/components/UserSelectMenuComponent.d.ts +3 -2
- package/lib/components/UserSelectMenuComponent.js +4 -1
- package/lib/components/command.d.ts +6 -5
- package/lib/components/command.js +4 -0
- package/lib/components/componentcontext.d.ts +42 -0
- package/lib/components/componentcontext.js +79 -0
- package/lib/components/handler.d.ts +3 -3
- package/lib/components/handler.js +9 -4
- package/lib/components/index.d.ts +2 -2
- package/lib/components/index.js +9 -9
- package/lib/events/handler.d.ts +2 -1
- package/lib/events/hooks/application_command.d.ts +2 -2
- package/lib/events/hooks/auto_moderation.d.ts +4 -4
- 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 -4
- package/lib/events/hooks/guild.d.ts +42 -42
- package/lib/events/hooks/integration.d.ts +19 -19
- package/lib/events/hooks/interactions.d.ts +2 -2
- package/lib/events/hooks/invite.d.ts +5 -5
- package/lib/events/hooks/message.d.ts +6 -5
- package/lib/events/hooks/presence.d.ts +7 -7
- package/lib/events/hooks/stage.d.ts +4 -4
- package/lib/events/hooks/thread.d.ts +49 -49
- package/lib/events/hooks/typing.d.ts +2 -2
- package/lib/events/hooks/user.d.ts +1 -1
- package/lib/events/hooks/voice.d.ts +2 -2
- package/lib/events/hooks/webhook.d.ts +1 -1
- package/lib/index.d.ts +3 -6
- package/lib/index.js +6 -7
- package/lib/langs/handler.d.ts +2 -1
- package/lib/structures/AutoModerationRule.d.ts +3 -2
- package/lib/structures/ClientUser.d.ts +1 -1
- package/lib/structures/Guild.d.ts +27 -27
- package/lib/structures/GuildEmoji.d.ts +2 -1
- package/lib/structures/GuildMember.d.ts +15 -6
- package/lib/structures/GuildMember.js +32 -6
- package/lib/structures/GuildPreview.d.ts +1 -1
- package/lib/structures/GuildRole.d.ts +2 -1
- package/lib/structures/GuildTemplate.d.ts +3 -2
- package/lib/structures/Interaction.d.ts +3 -3
- package/lib/structures/Interaction.js +33 -33
- package/lib/structures/Message.d.ts +5 -4
- package/lib/structures/Sticker.d.ts +2 -1
- package/lib/structures/User.d.ts +6 -3
- package/lib/structures/Webhook.d.ts +63 -4
- package/lib/structures/Webhook.js +53 -0
- package/lib/structures/channels.d.ts +2 -2
- package/lib/structures/extra/BaseGuild.d.ts +2 -1
- package/lib/structures/extra/BaseGuild.js +3 -3
- package/lib/structures/extra/BitField.d.ts +2 -2
- package/lib/structures/extra/BitField.js +2 -2
- package/lib/structures/extra/Permissions.d.ts +1 -1
- package/lib/structures/extra/functions.d.ts +2 -1
- package/lib/structures/extra/functions.js +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +17 -0
- package/lib/websocket/SharedTypes.d.ts +2 -1
- package/lib/websocket/SharedTypes.js +1 -0
- package/lib/websocket/discord/shard.d.ts +2 -1
- package/lib/websocket/discord/shard.js +30 -41
- package/lib/websocket/discord/sharder.d.ts +3 -2
- package/lib/websocket/discord/sharder.js +7 -6
- package/lib/websocket/discord/shared.d.ts +2 -1
- package/lib/websocket/discord/worker.d.ts +1 -1
- package/lib/websocket/discord/workermanager.d.ts +3 -2
- package/lib/websocket/discord/workermanager.js +1 -1
- package/package.json +2 -2
package/lib/client/base.d.ts
CHANGED
|
@@ -4,12 +4,13 @@ import { Cache } from '../cache';
|
|
|
4
4
|
import type { Command, ContextMenuCommand, RegisteredMiddlewares } from '../commands';
|
|
5
5
|
import type { InferWithPrefix, MiddlewareContext } from '../commands/applications/shared';
|
|
6
6
|
import { type CommandHandlerLike } from '../commands/handler';
|
|
7
|
-
import { ChannelShorter, EmojiShorter, GuildShorter, Logger, MemberShorter, MessageShorter, ReactionShorter, RoleShorter, TemplateShorter, UsersShorter, WebhookShorter, type
|
|
7
|
+
import { ChannelShorter, EmojiShorter, GuildShorter, Logger, MemberShorter, MessageShorter, ReactionShorter, RoleShorter, TemplateShorter, UsersShorter, WebhookShorter, type MakeRequired } from '../common';
|
|
8
|
+
import type { LocaleString } from 'discord-api-types/rest/v10';
|
|
8
9
|
import type { DeepPartial, IntentStrings, OmitInsert, When } from '../common/types/util';
|
|
9
10
|
import type { ComponentCommand, ModalCommand } from '../components';
|
|
10
11
|
import { type ComponentHandlerLike } from '../components/handler';
|
|
11
12
|
import { type LangsHandlerLike } from '../langs/handler';
|
|
12
|
-
import type { ChatInputCommandInteraction, Message, MessageCommandInteraction, UserCommandInteraction } from '../structures';
|
|
13
|
+
import type { ChatInputCommandInteraction, ComponentInteraction, Message, MessageCommandInteraction, UserCommandInteraction } from '../structures';
|
|
13
14
|
export declare class BaseClient {
|
|
14
15
|
rest: ApiHandler;
|
|
15
16
|
cache: Cache;
|
|
@@ -64,7 +65,7 @@ export declare class BaseClient {
|
|
|
64
65
|
}>;
|
|
65
66
|
}
|
|
66
67
|
export interface BaseClientOptions {
|
|
67
|
-
context?: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | When<InferWithPrefix, Message, never>) => {};
|
|
68
|
+
context?: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ComponentInteraction | When<InferWithPrefix, Message, never>) => {};
|
|
68
69
|
globalMiddlewares?: readonly (keyof RegisteredMiddlewares)[];
|
|
69
70
|
}
|
|
70
71
|
export interface StartOptions {
|
package/lib/client/client.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type GatewayDispatchPayload, type GatewayPresenceUpdateData } from 'discord-api-types/v10';
|
|
1
2
|
import type { ClientEvent, Command, CommandContext, EventHandlerLike, Message, SubCommand } from '..';
|
|
2
|
-
import {
|
|
3
|
+
import type { DeepPartial, If } from '../common';
|
|
3
4
|
import { ClientUser } from '../structures';
|
|
4
5
|
import { ShardManager, type ShardManagerOptions } from '../websocket';
|
|
5
6
|
import { MemberUpdateHandler } from '../websocket/discord/events/memberUpdate';
|
package/lib/client/client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Client = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
4
5
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
5
|
-
const common_1 = require("../common");
|
|
6
6
|
const events_1 = require("../events");
|
|
7
7
|
const structures_1 = require("../structures");
|
|
8
8
|
const websocket_1 = require("../websocket");
|
|
@@ -139,7 +139,7 @@ class Client extends base_1.BaseClient {
|
|
|
139
139
|
this.applicationId = packet.d.application.id;
|
|
140
140
|
this.me = new structures_1.ClientUser(this, packet.d.user, packet.d.application);
|
|
141
141
|
if (!this.__handleGuilds?.size ||
|
|
142
|
-
!((this.gateway.options.intents &
|
|
142
|
+
!((this.gateway.options.intents & v10_1.GatewayIntentBits.Guilds) === v10_1.GatewayIntentBits.Guilds)) {
|
|
143
143
|
if ([...this.gateway.values()].every(shard => shard.data.session_id)) {
|
|
144
144
|
await this.events?.runEvent('BOT_READY', this, this.me, -1);
|
|
145
145
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { type APIInteraction } from 'discord-api-types/v10';
|
|
2
3
|
import type { HttpRequest, HttpResponse } from 'uWebSockets.js';
|
|
3
|
-
import type {
|
|
4
|
+
import type { DeepPartial } from '../common';
|
|
4
5
|
import type { BaseClientOptions, StartOptions } from './base';
|
|
5
6
|
import { BaseClient } from './base';
|
|
6
7
|
export declare class HttpClient extends BaseClient {
|
package/lib/client/httpclient.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HttpClient = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
4
5
|
const magic_bytes_js_1 = require("magic-bytes.js");
|
|
5
6
|
const api_1 = require("../api");
|
|
6
7
|
const utils_1 = require("../api/utils/utils");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
8
|
const base_1 = require("./base");
|
|
9
9
|
const oninteractioncreate_1 = require("./oninteractioncreate");
|
|
10
10
|
let UWS;
|
|
@@ -104,11 +104,11 @@ class HttpClient extends base_1.BaseClient {
|
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
106
106
|
switch (rawBody.type) {
|
|
107
|
-
case
|
|
107
|
+
case v10_1.InteractionType.Ping:
|
|
108
108
|
this.debugger?.debug('Ping interaction received, responding.');
|
|
109
109
|
res
|
|
110
110
|
.writeHeader('Content-Type', 'application/json')
|
|
111
|
-
.end(JSON.stringify({ type:
|
|
111
|
+
.end(JSON.stringify({ type: v10_1.InteractionResponseType.Pong }));
|
|
112
112
|
break;
|
|
113
113
|
default:
|
|
114
114
|
await (0, oninteractioncreate_1.onInteractionCreate)(this, rawBody, -1, async ({ body, files }) => {
|
|
@@ -10,12 +10,12 @@ async function onInteractionCreate(self, body, shardId, __reply) {
|
|
|
10
10
|
case v10_1.InteractionType.ApplicationCommandAutocomplete:
|
|
11
11
|
{
|
|
12
12
|
const parentCommand = self.commands?.values.find(x => {
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
13
|
+
if (body.data.guild_id) {
|
|
14
|
+
return x.guild_id?.includes(body.data.guild_id) && x.name === body.data.name;
|
|
15
15
|
}
|
|
16
16
|
return x.name === body.data.name;
|
|
17
17
|
});
|
|
18
|
-
const optionsResolver = new commands_1.OptionResolver(self, body.data.options ?? [], parentCommand, body.
|
|
18
|
+
const optionsResolver = new commands_1.OptionResolver(self, body.data.options ?? [], parentCommand, body.guild_id, body.data.resolved);
|
|
19
19
|
const interaction = new structures_1.AutocompleteInteraction(self, body, __reply);
|
|
20
20
|
const command = optionsResolver.getAutocomplete();
|
|
21
21
|
// idc, is a YOU problem
|
|
@@ -48,8 +48,8 @@ async function onInteractionCreate(self, body, shardId, __reply) {
|
|
|
48
48
|
case v10_1.ApplicationCommandType.User:
|
|
49
49
|
{
|
|
50
50
|
const command = self.commands?.values.find(x => {
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
51
|
+
if (body.data.guild_id) {
|
|
52
|
+
return x.guild_id?.includes(body.data.guild_id) && x.name === body.data.name;
|
|
53
53
|
}
|
|
54
54
|
return x.name === body.data.name;
|
|
55
55
|
});
|
|
@@ -62,7 +62,7 @@ async function onInteractionCreate(self, body, shardId, __reply) {
|
|
|
62
62
|
Object.assign(context, extendContext);
|
|
63
63
|
try {
|
|
64
64
|
if (command.botPermissions && interaction.appPermissions) {
|
|
65
|
-
const permissions = interaction.appPermissions.missings(...interaction.appPermissions.values(command.botPermissions));
|
|
65
|
+
const permissions = interaction.appPermissions.missings(...interaction.appPermissions.values([command.botPermissions]));
|
|
66
66
|
if (permissions.length) {
|
|
67
67
|
return command.onPermissionsFail?.(context, interaction.appPermissions.keys(permissions));
|
|
68
68
|
}
|
|
@@ -102,14 +102,13 @@ async function onInteractionCreate(self, body, shardId, __reply) {
|
|
|
102
102
|
break;
|
|
103
103
|
case v10_1.ApplicationCommandType.ChatInput:
|
|
104
104
|
{
|
|
105
|
-
const packetData = body.data;
|
|
106
105
|
const parentCommand = self.commands?.values.find(x => {
|
|
107
|
-
if (
|
|
108
|
-
return
|
|
106
|
+
if (body.data.guild_id) {
|
|
107
|
+
return x.guild_id?.includes(body.data.guild_id) && x.name === body.data.name;
|
|
109
108
|
}
|
|
110
|
-
return x.name ===
|
|
109
|
+
return x.name === body.data.name;
|
|
111
110
|
});
|
|
112
|
-
const optionsResolver = new commands_1.OptionResolver(self,
|
|
111
|
+
const optionsResolver = new commands_1.OptionResolver(self, body.data.options ?? [], parentCommand, body.guild_id, body.data.resolved);
|
|
113
112
|
const interaction = structures_1.BaseInteraction.from(self, body, __reply);
|
|
114
113
|
const command = optionsResolver.getCommand();
|
|
115
114
|
if (!command?.run)
|
|
@@ -119,7 +118,7 @@ async function onInteractionCreate(self, body, shardId, __reply) {
|
|
|
119
118
|
Object.assign(context, extendContext);
|
|
120
119
|
try {
|
|
121
120
|
if (command.botPermissions && interaction.appPermissions) {
|
|
122
|
-
const permissions = interaction.appPermissions.missings(...interaction.appPermissions.values(command.botPermissions));
|
|
121
|
+
const permissions = interaction.appPermissions.missings(...interaction.appPermissions.values([command.botPermissions]));
|
|
123
122
|
if (permissions.length) {
|
|
124
123
|
return command.onPermissionsFail?.(context, interaction.appPermissions.keys(permissions));
|
|
125
124
|
}
|
|
@@ -53,8 +53,7 @@ async function onMessageCreate(self, rawMessage, shardId) {
|
|
|
53
53
|
return;
|
|
54
54
|
if (!command.run)
|
|
55
55
|
return self.logger.warn(`${fullCommandName} command does not have 'run' callback`);
|
|
56
|
-
if (
|
|
57
|
-
!message.guildId)
|
|
56
|
+
if (!command.contexts?.includes(__1.InteractionContextTypes.BOT_DM) && !message.guildId)
|
|
58
57
|
return;
|
|
59
58
|
if (command.guild_id && !command.guild_id?.includes(message.guildId))
|
|
60
59
|
return;
|
|
@@ -78,7 +77,7 @@ async function onMessageCreate(self, rawMessage, shardId) {
|
|
|
78
77
|
if (!meMember)
|
|
79
78
|
return; //enable member cache and "Guilds" intent, lol
|
|
80
79
|
const appPermissions = await meMember.fetchPermissions();
|
|
81
|
-
const permissions = appPermissions.missings(...appPermissions.values(command.botPermissions));
|
|
80
|
+
const permissions = appPermissions.missings(...appPermissions.values([command.botPermissions]));
|
|
82
81
|
if (permissions.length) {
|
|
83
82
|
return command.onPermissionsFail?.(context, appPermissions.keys(permissions));
|
|
84
83
|
}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
/// <reference types="node" />
|
|
4
4
|
/// <reference types="node" />
|
|
5
5
|
/// <reference types="node" />
|
|
6
|
+
import { type GatewayDispatchPayload } from 'discord-api-types/v10';
|
|
7
|
+
import { Logger } from '..';
|
|
6
8
|
import type { Cache } from '../cache';
|
|
7
|
-
import type
|
|
8
|
-
import { Logger, type DeepPartial } from '../common';
|
|
9
|
+
import { type DeepPartial, type When } from '../common';
|
|
9
10
|
import { type EventHandlerLike } from '../events';
|
|
10
11
|
import { ClientUser } from '../structures';
|
|
11
12
|
import { Shard, type ShardManagerOptions } from '../websocket';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateShardInfo = exports.WorkerClient = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
4
5
|
const node_crypto_1 = require("node:crypto");
|
|
5
6
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
6
7
|
const __1 = require("..");
|
|
@@ -27,7 +28,7 @@ try {
|
|
|
27
28
|
catch { }
|
|
28
29
|
class WorkerClient extends base_1.BaseClient {
|
|
29
30
|
__handleGuilds = new Set();
|
|
30
|
-
logger = new
|
|
31
|
+
logger = new __1.Logger({
|
|
31
32
|
name: `[Worker #${workerData.workerId}]`,
|
|
32
33
|
});
|
|
33
34
|
events = new events_1.EventHandler(this.logger);
|
|
@@ -51,7 +52,7 @@ class WorkerClient extends base_1.BaseClient {
|
|
|
51
52
|
},
|
|
52
53
|
});
|
|
53
54
|
if (workerData.debug) {
|
|
54
|
-
this.debugger = new
|
|
55
|
+
this.debugger = new __1.Logger({
|
|
55
56
|
name: `[Worker #${workerData.workerId}]`,
|
|
56
57
|
logLevel: common_1.LogLevels.Debug,
|
|
57
58
|
});
|
|
@@ -298,7 +299,7 @@ class WorkerClient extends base_1.BaseClient {
|
|
|
298
299
|
this.applicationId = packet.d.application.id;
|
|
299
300
|
this.me = new structures_1.ClientUser(this, packet.d.user, packet.d.application);
|
|
300
301
|
if (!this.__handleGuilds?.size ||
|
|
301
|
-
!((workerData.intents &
|
|
302
|
+
!((workerData.intents & v10_1.GatewayIntentBits.Guilds) === v10_1.GatewayIntentBits.Guilds)) {
|
|
302
303
|
if ([...this.shards.values()].every(shard => shard.data.session_id)) {
|
|
303
304
|
this.postMessage({
|
|
304
305
|
type: 'WORKER_READY',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type APIApplicationCommandBasicOption, type APIApplicationCommandOption, ApplicationCommandOptionType, ApplicationCommandType, type LocaleString } from 'discord-api-types/v10';
|
|
2
|
+
import type { PermissionStrings, SeyfertNumberOption, SeyfertStringOption } from '../..';
|
|
2
3
|
import type { Attachment } from '../../builders';
|
|
3
|
-
import
|
|
4
|
-
import { ApplicationCommandOptionType, ApplicationCommandType } from '../../common';
|
|
4
|
+
import { type FlatObjectKeys } from '../../common';
|
|
5
5
|
import type { AllChannels, AutocompleteInteraction, GuildRole, InteractionGuildMember, User } from '../../structures';
|
|
6
6
|
import type { Groups, IntegrationTypes, InteractionContextTypes, RegisteredMiddlewares } from '../decorators';
|
|
7
7
|
import type { CommandContext } from './chatcontext';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SubCommand = exports.Command = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
class BaseCommand {
|
|
6
7
|
middlewares = [];
|
|
@@ -136,7 +137,7 @@ class BaseCommand {
|
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
class Command extends BaseCommand {
|
|
139
|
-
type =
|
|
140
|
+
type = v10_1.ApplicationCommandType.ChatInput;
|
|
140
141
|
groups;
|
|
141
142
|
toJSON() {
|
|
142
143
|
const options = [];
|
|
@@ -148,7 +149,7 @@ class Command extends BaseCommand {
|
|
|
148
149
|
if (i.group) {
|
|
149
150
|
if (!options.find(x => x.name === i.group)) {
|
|
150
151
|
options.push({
|
|
151
|
-
type:
|
|
152
|
+
type: v10_1.ApplicationCommandOptionType.SubcommandGroup,
|
|
152
153
|
name: i.group,
|
|
153
154
|
description: this.groups[i.group].defaultDescription,
|
|
154
155
|
description_localizations: Object.fromEntries(this.groups?.[i.group].description ?? []),
|
|
@@ -185,7 +186,7 @@ class Command extends BaseCommand {
|
|
|
185
186
|
}
|
|
186
187
|
exports.Command = Command;
|
|
187
188
|
class SubCommand extends BaseCommand {
|
|
188
|
-
type =
|
|
189
|
+
type = v10_1.ApplicationCommandOptionType.Subcommand;
|
|
189
190
|
group;
|
|
190
191
|
toJSON() {
|
|
191
192
|
return {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { AllChannels, Guild, InferWithPrefix, ReturnCache, WebhookMessage } from '../..';
|
|
2
|
+
import type { If, UnionToTuple, When } from '../../common';
|
|
3
3
|
import type { InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest } from '../../common/types/write';
|
|
4
4
|
import { Message, type ChatInputCommandInteraction, type GuildMember, type InteractionGuildMember } from '../../structures';
|
|
5
|
+
import { BaseContext } from '../basecontex';
|
|
5
6
|
import type { RegisteredMiddlewares } from '../decorators';
|
|
6
7
|
import type { OptionResolver } from '../optionresolver';
|
|
7
8
|
import type { Command, ContextOptions, OptionsRecord, SubCommand } from './chat';
|
|
8
9
|
import type { CommandMetadata, ExtendContext, GlobalMetadata, UsingClient } from './shared';
|
|
9
|
-
export interface CommandContext<T extends OptionsRecord = {}, M extends keyof RegisteredMiddlewares = never> extends ExtendContext {
|
|
10
|
+
export interface CommandContext<T extends OptionsRecord = {}, M extends keyof RegisteredMiddlewares = never> extends BaseContext, ExtendContext {
|
|
10
11
|
}
|
|
11
|
-
export declare class CommandContext<T extends OptionsRecord = {}, M extends keyof RegisteredMiddlewares = never> {
|
|
12
|
+
export declare class CommandContext<T extends OptionsRecord = {}, M extends keyof RegisteredMiddlewares = never> extends BaseContext {
|
|
12
13
|
readonly client: UsingClient;
|
|
13
14
|
readonly resolver: OptionResolver;
|
|
14
15
|
readonly shardId: number;
|
|
@@ -39,10 +40,6 @@ export declare class CommandContext<T extends OptionsRecord = {}, M extends keyo
|
|
|
39
40
|
guild(mode?: 'cache'): ReturnCache<Guild<'cached'> | undefined>;
|
|
40
41
|
get guildId(): string | undefined;
|
|
41
42
|
get channelId(): string;
|
|
42
|
-
get author(): User;
|
|
43
|
+
get author(): import("../..").User;
|
|
43
44
|
get member(): If<InferWithPrefix, GuildMember | InteractionGuildMember | undefined, InteractionGuildMember | undefined>;
|
|
44
|
-
isChat(): this is CommandContext;
|
|
45
|
-
isMenu(): this is MenuCommandContext<any>;
|
|
46
|
-
isMenuUser(): this is MenuCommandContext<UserCommandInteraction>;
|
|
47
|
-
isMenuMessage(): this is MenuCommandContext<MessageCommandInteraction>;
|
|
48
45
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommandContext = void 0;
|
|
4
|
-
const
|
|
5
|
-
const common_1 = require("../../common");
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
6
5
|
const structures_1 = require("../../structures");
|
|
7
|
-
|
|
6
|
+
const basecontex_1 = require("../basecontex");
|
|
7
|
+
class CommandContext extends basecontex_1.BaseContext {
|
|
8
8
|
client;
|
|
9
9
|
resolver;
|
|
10
10
|
shardId;
|
|
@@ -13,6 +13,7 @@ class CommandContext {
|
|
|
13
13
|
interaction;
|
|
14
14
|
messageResponse;
|
|
15
15
|
constructor(client, data, resolver, shardId, command) {
|
|
16
|
+
super(client);
|
|
16
17
|
this.client = client;
|
|
17
18
|
this.resolver = resolver;
|
|
18
19
|
this.shardId = shardId;
|
|
@@ -31,7 +32,7 @@ class CommandContext {
|
|
|
31
32
|
return this.client.proxy;
|
|
32
33
|
}
|
|
33
34
|
get t() {
|
|
34
|
-
return this.client.
|
|
35
|
+
return this.client.t(this.interaction?.locale ?? this.client.langs?.defaultLang ?? 'en-US');
|
|
35
36
|
}
|
|
36
37
|
get fullCommandName() {
|
|
37
38
|
return this.resolver.fullCommandName;
|
|
@@ -44,7 +45,7 @@ class CommandContext {
|
|
|
44
45
|
}
|
|
45
46
|
async deferReply(ephemeral = false) {
|
|
46
47
|
if (this.interaction)
|
|
47
|
-
return this.interaction.deferReply(ephemeral ?
|
|
48
|
+
return this.interaction.deferReply(ephemeral ? v10_1.MessageFlags.Ephemeral : undefined);
|
|
48
49
|
const options = this.client.options?.commands;
|
|
49
50
|
return (this.messageResponse = await this.message[options?.reply?.(this) ? 'reply' : 'write'](options?.deferReplyResponse?.(this) ?? { content: 'Thinking...' }));
|
|
50
51
|
}
|
|
@@ -121,17 +122,5 @@ class CommandContext {
|
|
|
121
122
|
get member() {
|
|
122
123
|
return this.interaction?.member || this.message?.member;
|
|
123
124
|
}
|
|
124
|
-
isChat() {
|
|
125
|
-
return this instanceof CommandContext;
|
|
126
|
-
}
|
|
127
|
-
isMenu() {
|
|
128
|
-
return this instanceof __1.MenuCommandContext;
|
|
129
|
-
}
|
|
130
|
-
isMenuUser() {
|
|
131
|
-
return this instanceof __1.MenuCommandContext && this.target instanceof __1.User;
|
|
132
|
-
}
|
|
133
|
-
isMenuMessage() {
|
|
134
|
-
return this instanceof __1.MenuCommandContext && this.target instanceof structures_1.Message;
|
|
135
|
-
}
|
|
136
125
|
}
|
|
137
126
|
exports.CommandContext = CommandContext;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ApplicationCommandType, LocaleString } from 'discord-api-types/v10';
|
|
2
|
+
import { type PermissionStrings } from '../../common';
|
|
2
3
|
import type { IntegrationTypes, InteractionContextTypes, RegisteredMiddlewares } from '../decorators';
|
|
3
4
|
import type { MenuCommandContext } from './menucontext';
|
|
4
5
|
import type { UsingClient } from './shared';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ContextMenuCommand, ReturnCache, WebhookMessage } from '../..';
|
|
2
2
|
import { type InteractionCreateBodyRequest, type InteractionMessageUpdateBodyRequest, type UnionToTuple, type When } from '../../common';
|
|
3
3
|
import { Message, User, type AllChannels, type Guild, type GuildMember, type MessageCommandInteraction, type UserCommandInteraction } from '../../structures';
|
|
4
|
+
import { BaseContext } from '../basecontex';
|
|
4
5
|
import type { RegisteredMiddlewares } from '../decorators';
|
|
5
6
|
import type { CommandMetadata, ExtendContext, GlobalMetadata, UsingClient } from './shared';
|
|
6
7
|
export type InteractionTarget<T> = T extends MessageCommandInteraction ? Message : User;
|
|
7
|
-
export interface MenuCommandContext<T extends MessageCommandInteraction | UserCommandInteraction, M extends keyof RegisteredMiddlewares = never> extends ExtendContext {
|
|
8
|
+
export interface MenuCommandContext<T extends MessageCommandInteraction | UserCommandInteraction, M extends keyof RegisteredMiddlewares = never> extends BaseContext, ExtendContext {
|
|
8
9
|
}
|
|
9
|
-
export declare class MenuCommandContext<T extends MessageCommandInteraction | UserCommandInteraction, M extends keyof RegisteredMiddlewares = never> {
|
|
10
|
+
export declare class MenuCommandContext<T extends MessageCommandInteraction | UserCommandInteraction, M extends keyof RegisteredMiddlewares = never> extends BaseContext {
|
|
10
11
|
readonly client: UsingClient;
|
|
11
12
|
readonly interaction: T;
|
|
12
13
|
readonly shardId: number;
|
|
@@ -14,7 +15,6 @@ export declare class MenuCommandContext<T extends MessageCommandInteraction | Us
|
|
|
14
15
|
constructor(client: UsingClient, interaction: T, shardId: number, command: ContextMenuCommand);
|
|
15
16
|
metadata: CommandMetadata<UnionToTuple<M>>;
|
|
16
17
|
globalMetadata: GlobalMetadata;
|
|
17
|
-
get proxy(): import("../..").APIRoutes;
|
|
18
18
|
get target(): InteractionTarget<T>;
|
|
19
19
|
get t(): import("../..").__InternalParseLocale<import("./shared").DefaultLocale> & {
|
|
20
20
|
get(locale?: string | undefined): import("./shared").DefaultLocale;
|
|
@@ -37,8 +37,4 @@ export declare class MenuCommandContext<T extends MessageCommandInteraction | Us
|
|
|
37
37
|
get channelId(): string;
|
|
38
38
|
get author(): User;
|
|
39
39
|
get member(): import("../..").InteractionGuildMember | undefined;
|
|
40
|
-
isChat(): this is CommandContext;
|
|
41
|
-
isMenu(): this is MenuCommandContext<any>;
|
|
42
|
-
isMenuUser(): this is MenuCommandContext<UserCommandInteraction>;
|
|
43
|
-
isMenuMessage(): this is MenuCommandContext<MessageCommandInteraction>;
|
|
44
40
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MenuCommandContext = void 0;
|
|
4
|
-
const
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
5
5
|
const common_1 = require("../../common");
|
|
6
6
|
const structures_1 = require("../../structures");
|
|
7
|
-
|
|
7
|
+
const basecontex_1 = require("../basecontex");
|
|
8
|
+
class MenuCommandContext extends basecontex_1.BaseContext {
|
|
8
9
|
client;
|
|
9
10
|
interaction;
|
|
10
11
|
shardId;
|
|
11
12
|
command;
|
|
12
13
|
constructor(client, interaction, shardId, command) {
|
|
14
|
+
super(client);
|
|
13
15
|
this.client = client;
|
|
14
16
|
this.interaction = interaction;
|
|
15
17
|
this.shardId = shardId;
|
|
@@ -17,17 +19,14 @@ class MenuCommandContext {
|
|
|
17
19
|
}
|
|
18
20
|
metadata = {};
|
|
19
21
|
globalMetadata = {};
|
|
20
|
-
get proxy() {
|
|
21
|
-
return this.client.proxy;
|
|
22
|
-
}
|
|
23
22
|
// biome-ignore lint/suspicious/useGetterReturn: default don't exist.
|
|
24
23
|
get target() {
|
|
25
24
|
switch (this.interaction.data.type) {
|
|
26
|
-
case
|
|
25
|
+
case v10_1.ApplicationCommandType.Message: {
|
|
27
26
|
const data = this.interaction.data.resolved.messages[this.interaction.data.targetId];
|
|
28
27
|
return new structures_1.Message(this.client, (0, common_1.toSnakeCase)(data));
|
|
29
28
|
}
|
|
30
|
-
case
|
|
29
|
+
case v10_1.ApplicationCommandType.User: {
|
|
31
30
|
const data = this.interaction.data.resolved.users[this.interaction.data.targetId];
|
|
32
31
|
return new structures_1.User(this.client, (0, common_1.toSnakeCase)(data));
|
|
33
32
|
}
|
|
@@ -46,7 +45,7 @@ class MenuCommandContext {
|
|
|
46
45
|
return this.interaction.modal;
|
|
47
46
|
}
|
|
48
47
|
deferReply(ephemeral = false) {
|
|
49
|
-
return this.interaction.deferReply(ephemeral ?
|
|
48
|
+
return this.interaction.deferReply(ephemeral ? v10_1.MessageFlags.Ephemeral : undefined);
|
|
50
49
|
}
|
|
51
50
|
editResponse(body) {
|
|
52
51
|
return this.interaction.editResponse(body);
|
|
@@ -97,17 +96,5 @@ class MenuCommandContext {
|
|
|
97
96
|
get member() {
|
|
98
97
|
return this.interaction.member;
|
|
99
98
|
}
|
|
100
|
-
isChat() {
|
|
101
|
-
return this instanceof __1.CommandContext;
|
|
102
|
-
}
|
|
103
|
-
isMenu() {
|
|
104
|
-
return this instanceof MenuCommandContext;
|
|
105
|
-
}
|
|
106
|
-
isMenuUser() {
|
|
107
|
-
return this instanceof MenuCommandContext && this.target instanceof structures_1.User;
|
|
108
|
-
}
|
|
109
|
-
isMenuMessage() {
|
|
110
|
-
return this instanceof MenuCommandContext && this.target instanceof structures_1.Message;
|
|
111
|
-
}
|
|
112
99
|
}
|
|
113
100
|
exports.MenuCommandContext = MenuCommandContext;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentCommandInteractionMap, ComponentContext } from '../components/componentcontext';
|
|
2
|
+
import { type MessageCommandInteraction, type UserCommandInteraction } from '../structures';
|
|
3
|
+
import type { CommandContext } from './applications/chatcontext';
|
|
4
|
+
import type { MenuCommandContext } from './applications/menucontext';
|
|
5
|
+
import type { UsingClient } from './applications/shared';
|
|
6
|
+
export declare class BaseContext {
|
|
7
|
+
readonly client: UsingClient;
|
|
8
|
+
constructor(client: UsingClient);
|
|
9
|
+
get proxy(): import("..").APIRoutes;
|
|
10
|
+
isChat(): this is CommandContext;
|
|
11
|
+
isMenu(): this is MenuCommandContext<UserCommandInteraction | MessageCommandInteraction>;
|
|
12
|
+
isMenuUser(): this is MenuCommandContext<UserCommandInteraction>;
|
|
13
|
+
isMenuMessage(): this is MenuCommandContext<MessageCommandInteraction>;
|
|
14
|
+
isComponent(): this is ComponentContext<keyof ComponentCommandInteractionMap>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseContext = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
5
|
+
const structures_1 = require("../structures");
|
|
6
|
+
class BaseContext {
|
|
7
|
+
client;
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
get proxy() {
|
|
12
|
+
return this.client.proxy;
|
|
13
|
+
}
|
|
14
|
+
isChat() {
|
|
15
|
+
//@ts-expect-error
|
|
16
|
+
return this.message || this.interaction.type === v10_1.ApplicationCommandType.ChatInput;
|
|
17
|
+
}
|
|
18
|
+
isMenu() {
|
|
19
|
+
return this.isMenuUser() || this.isMenuMessage();
|
|
20
|
+
}
|
|
21
|
+
isMenuUser() {
|
|
22
|
+
//@ts-expect-error
|
|
23
|
+
return this.target instanceof structures_1.User;
|
|
24
|
+
}
|
|
25
|
+
isMenuMessage() {
|
|
26
|
+
//@ts-expect-error
|
|
27
|
+
return this.target instanceof structures_1.Message;
|
|
28
|
+
}
|
|
29
|
+
isComponent() {
|
|
30
|
+
//@ts-expect-error
|
|
31
|
+
return this.interaction.type === v10_1.InteractionType.MessageComponent;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.BaseContext = BaseContext;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ApplicationCommandType, type
|
|
1
|
+
import { ApplicationCommandType, type LocaleString } from 'discord-api-types/v10';
|
|
2
|
+
import type { FlatObjectKeys, PermissionStrings } from '../common';
|
|
2
3
|
import type { CommandOption, OptionsRecord, SubCommand } from './applications/chat';
|
|
3
4
|
import type { DefaultLocale, MiddlewareContext } from './applications/shared';
|
|
4
5
|
export interface RegisteredMiddlewares {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Declare = exports.Middlewares = exports.AutoLoad = exports.Options = exports.Group = exports.Groups = exports.GroupsT = exports.LocalesT = exports.Locales = exports.InteractionContextTypes = exports.IntegrationTypes = void 0;
|
|
4
|
-
const
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
5
5
|
var IntegrationTypes;
|
|
6
6
|
(function (IntegrationTypes) {
|
|
7
7
|
IntegrationTypes[IntegrationTypes["GUILD_INSTALL"] = 0] = "GUILD_INSTALL";
|
|
@@ -76,13 +76,13 @@ function Declare(declare) {
|
|
|
76
76
|
contexts = declare.contexts?.map(i => InteractionContextTypes[i]);
|
|
77
77
|
integration_types = declare.integrationTypes?.map(i => IntegrationTypes[i]);
|
|
78
78
|
default_member_permissions = Array.isArray(declare.defaultMemberPermissions)
|
|
79
|
-
? declare.defaultMemberPermissions?.reduce((acc, prev) => acc |
|
|
79
|
+
? declare.defaultMemberPermissions?.reduce((acc, prev) => acc | v10_1.PermissionFlagsBits[prev], BigInt(0)).toString()
|
|
80
80
|
: declare.defaultMemberPermissions;
|
|
81
81
|
botPermissions = Array.isArray(declare.botPermissions)
|
|
82
|
-
? declare.botPermissions?.reduce((acc, prev) => acc |
|
|
82
|
+
? declare.botPermissions?.reduce((acc, prev) => acc | v10_1.PermissionFlagsBits[prev], BigInt(0))
|
|
83
83
|
: declare.botPermissions;
|
|
84
84
|
description = '';
|
|
85
|
-
type =
|
|
85
|
+
type = v10_1.ApplicationCommandType.ChatInput;
|
|
86
86
|
guild_id;
|
|
87
87
|
constructor(...args) {
|
|
88
88
|
super(...args);
|
package/lib/commands/handler.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommandHandler = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
4
5
|
const node_path_1 = require("node:path");
|
|
5
6
|
const common_1 = require("../common");
|
|
6
7
|
const chat_1 = require("./applications/chat");
|
|
@@ -116,7 +117,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
116
117
|
command.description_localizations = {};
|
|
117
118
|
for (const locale of Object.keys(client.langs.values)) {
|
|
118
119
|
const locales = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
|
|
119
|
-
if (Object.values(
|
|
120
|
+
if (Object.values(v10_1.Locale).includes(locale))
|
|
120
121
|
locales.push(locale);
|
|
121
122
|
if (command.__t.name) {
|
|
122
123
|
for (const i of locales) {
|
|
@@ -141,7 +142,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
141
142
|
options.description_localizations = {};
|
|
142
143
|
for (const locale of Object.keys(client.langs.values)) {
|
|
143
144
|
const locales = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
|
|
144
|
-
if (Object.values(
|
|
145
|
+
if (Object.values(v10_1.Locale).includes(locale))
|
|
145
146
|
locales.push(locale);
|
|
146
147
|
if (options.locales.name) {
|
|
147
148
|
for (const i of locales) {
|
|
@@ -163,7 +164,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
163
164
|
command.groups = {};
|
|
164
165
|
for (const locale of Object.keys(client.langs.values)) {
|
|
165
166
|
const locales = this.client.langs.aliases.find(x => x[0] === locale)?.[1] ?? [];
|
|
166
|
-
if (Object.values(
|
|
167
|
+
if (Object.values(v10_1.Locale).includes(locale))
|
|
167
168
|
locales.push(locale);
|
|
168
169
|
for (const group in command.__tGroups) {
|
|
169
170
|
command.groups[group] ??= {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type APIApplicationCommandInteractionDataOption, type APIAttachment, type APIGuildMember, type APIInteractionDataResolvedChannel, type APIInteractionGuildMember, type APIRole, type APIUser, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
|
1
2
|
import { Attachment, GuildMember } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
import { ApplicationCommandOptionType } from '../common';
|
|
3
|
+
import type { MakeRequired } from '../common';
|
|
4
4
|
import type { AllChannels } from '../structures';
|
|
5
5
|
import { GuildRole, InteractionGuildMember, User } from '../structures';
|
|
6
6
|
import type { Command, CommandAutocompleteOption, SubCommand } from './applications/chat';
|
|
@@ -31,7 +31,7 @@ export declare class OptionResolver {
|
|
|
31
31
|
getGroup(): string | null;
|
|
32
32
|
get(name: string): OptionResolved | undefined;
|
|
33
33
|
getHoisted(name: string): OptionResolved | undefined;
|
|
34
|
-
getValue(name: string): string | number | boolean | Attachment | GuildRole | GuildMember | User | import("..").BaseChannel<import("discord-api-types/
|
|
34
|
+
getValue(name: string): string | number | boolean | Attachment | GuildRole | GuildMember | User | import("..").BaseChannel<import("discord-api-types/v10").ChannelType> | import("..").DMChannel | import("..").CategoryChannel | InteractionGuildMember | undefined;
|
|
35
35
|
private getTypedOption;
|
|
36
36
|
getChannel(name: string, required?: true): AllChannels;
|
|
37
37
|
getString(name: string, required?: true): string;
|