seyfert 2.1.1-dev-11537652481.0 → 2.1.1-dev-11566750568.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/client/base.js
CHANGED
|
@@ -299,10 +299,13 @@ class BaseClient {
|
|
|
299
299
|
};
|
|
300
300
|
for (const i in locations) {
|
|
301
301
|
const key = i;
|
|
302
|
-
const location = locations[
|
|
303
|
-
if (
|
|
302
|
+
const location = locations[key];
|
|
303
|
+
if (key in locationsFullPaths)
|
|
304
304
|
continue;
|
|
305
|
-
|
|
305
|
+
if (typeof location === 'string')
|
|
306
|
+
locationsFullPaths[key] = (0, node_path_1.join)(process.cwd(), locations.output, location);
|
|
307
|
+
else
|
|
308
|
+
locationsFullPaths[key] = location;
|
|
306
309
|
}
|
|
307
310
|
const obj = {
|
|
308
311
|
debug: !!debug,
|
package/lib/commands/handle.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare class HandleCommand {
|
|
|
16
16
|
client: UsingClient;
|
|
17
17
|
constructor(client: UsingClient);
|
|
18
18
|
autocomplete(interaction: AutocompleteInteraction, optionsResolver: OptionResolverStructure, command?: CommandAutocompleteOption): Promise<void>;
|
|
19
|
+
contextMenu(command: ContextMenuCommand, interaction: MessageCommandInteraction | UserCommandInteraction, context: MenuCommandContext<MessageCommandInteraction | UserCommandInteraction>): Promise<any>;
|
|
19
20
|
contextMenuMessage(command: ContextMenuCommand, interaction: MessageCommandInteraction, context: MenuCommandContext<MessageCommandInteraction>): Promise<any>;
|
|
20
21
|
contextMenuUser(command: ContextMenuCommand, interaction: UserCommandInteraction, context: MenuCommandContext<UserCommandInteraction>): Promise<any>;
|
|
21
22
|
entryPoint(command: EntryPointCommand, interaction: EntryPointInteraction, context: EntryPointContext): Promise<any>;
|
package/lib/commands/handle.js
CHANGED
|
@@ -36,12 +36,8 @@ class HandleCommand {
|
|
|
36
36
|
// pass
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
async
|
|
40
|
-
|
|
41
|
-
return this.contextMenuUser(command, interaction, context);
|
|
42
|
-
}
|
|
43
|
-
async contextMenuUser(command, interaction, context) {
|
|
44
|
-
if (context.guildId && command.botPermissions && interaction.appPermissions) {
|
|
39
|
+
async contextMenu(command, interaction, context) {
|
|
40
|
+
if (context.guildId && command.botPermissions) {
|
|
45
41
|
const permissions = this.checkPermissions(interaction.appPermissions, command.botPermissions);
|
|
46
42
|
if (permissions)
|
|
47
43
|
return command.onBotPermissionsFail(context, permissions);
|
|
@@ -71,8 +67,14 @@ class HandleCommand {
|
|
|
71
67
|
}
|
|
72
68
|
}
|
|
73
69
|
}
|
|
70
|
+
contextMenuMessage(command, interaction, context) {
|
|
71
|
+
return this.contextMenu(command, interaction, context);
|
|
72
|
+
}
|
|
73
|
+
contextMenuUser(command, interaction, context) {
|
|
74
|
+
return this.contextMenu(command, interaction, context);
|
|
75
|
+
}
|
|
74
76
|
async entryPoint(command, interaction, context) {
|
|
75
|
-
if (context.guildId && command.botPermissions
|
|
77
|
+
if (context.guildId && command.botPermissions) {
|
|
76
78
|
const permissions = this.checkPermissions(interaction.appPermissions, command.botPermissions);
|
|
77
79
|
if (permissions)
|
|
78
80
|
return command.onBotPermissionsFail(context, permissions);
|
|
@@ -103,7 +105,7 @@ class HandleCommand {
|
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
async chatInput(command, interaction, resolver, context) {
|
|
106
|
-
if (context.guildId
|
|
108
|
+
if (context.guildId) {
|
|
107
109
|
if (command.botPermissions) {
|
|
108
110
|
const permissions = this.checkPermissions(interaction.appPermissions, command.botPermissions);
|
|
109
111
|
if (permissions)
|
|
@@ -172,17 +174,14 @@ class HandleCommand {
|
|
|
172
174
|
const data = this.makeMenuCommand(body, shardId, __reply);
|
|
173
175
|
if (!data)
|
|
174
176
|
return;
|
|
175
|
-
this.contextMenuMessage(data.command,
|
|
176
|
-
// @ts-expect-error
|
|
177
|
-
data.interaction, data.context);
|
|
177
|
+
await this.contextMenuMessage(data.command, data.interaction, data.context);
|
|
178
178
|
break;
|
|
179
179
|
}
|
|
180
180
|
case types_1.ApplicationCommandType.User: {
|
|
181
181
|
const data = this.makeMenuCommand(body, shardId, __reply);
|
|
182
182
|
if (!data)
|
|
183
183
|
return;
|
|
184
|
-
|
|
185
|
-
this.contextMenuUser(data.command, data.interaction, data.context);
|
|
184
|
+
await this.contextMenuUser(data.command, data.interaction, data.context);
|
|
186
185
|
break;
|
|
187
186
|
}
|
|
188
187
|
case types_1.ApplicationCommandType.PrimaryEntryPoint: {
|
|
@@ -199,10 +198,10 @@ class HandleCommand {
|
|
|
199
198
|
case types_1.ApplicationCommandType.ChatInput: {
|
|
200
199
|
const parentCommand = this.getCommand(body.data);
|
|
201
200
|
const optionsResolver = this.makeResolver(this.client, body.data.options ?? [], parentCommand, body.guild_id, body.data.resolved);
|
|
202
|
-
const interaction = structures_1.BaseInteraction.from(this.client, body, __reply);
|
|
203
201
|
const command = optionsResolver.getCommand();
|
|
204
202
|
if (!command?.run)
|
|
205
203
|
return this.client.logger.warn(`${optionsResolver.fullCommandName} command does not have 'run' callback`);
|
|
204
|
+
const interaction = structures_1.BaseInteraction.from(this.client, body, __reply);
|
|
206
205
|
const context = new _1.CommandContext(this.client, interaction, optionsResolver, shardId, command);
|
|
207
206
|
const extendContext = this.client.options?.context?.(interaction) ?? {};
|
|
208
207
|
Object.assign(context, extendContext);
|
|
@@ -29,7 +29,7 @@ export declare class BaseInteraction<FromGuild extends boolean = boolean, Type e
|
|
|
29
29
|
channel?: AllChannels;
|
|
30
30
|
message?: MessageStructure;
|
|
31
31
|
replied?: Promise<boolean | RESTPostAPIInteractionCallbackResult | undefined> | boolean;
|
|
32
|
-
appPermissions
|
|
32
|
+
appPermissions: PermissionsBitField;
|
|
33
33
|
entitlements: EntitlementStructure[];
|
|
34
34
|
constructor(client: UsingClient, interaction: Type, __reply?: __InternalReplyFunction | undefined);
|
|
35
35
|
static transformBodyRequest(body: ReplyInteractionBody, files: RawFile[] | undefined, self: UsingClient): APIInteractionResponse;
|
|
@@ -35,9 +35,7 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
|
35
35
|
if (interaction.message) {
|
|
36
36
|
this.message = transformers_1.Transformers.Message(client, interaction.message);
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
this.appPermissions = new Permissions_1.PermissionsBitField(Number(interaction.app_permissions));
|
|
40
|
-
}
|
|
38
|
+
this.appPermissions = new Permissions_1.PermissionsBitField(Number(interaction.app_permissions));
|
|
41
39
|
if (interaction.channel) {
|
|
42
40
|
this.channel = (0, _1.channelFrom)(interaction.channel, client);
|
|
43
41
|
}
|