Skip to content

Commit 9ead69e

Browse files
author
Vadym
committed
mmm
1 parent d90f9c7 commit 9ead69e

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/commands/chatInput/account/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ const accountSubcommands = readdirSync(__dirname)
88
export default {
99
name: "account",
1010
description: "аккаунт",
11-
public: true,
1211
subcommands: accountSubcommands
1312
} satisfies FirstLevelChatInputCommand;

src/commands/chatInput/account/register.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { ApplicationCommandOptionType } from "discord.js";
2-
import type { SecondLevelChatInputCommand } from "..";
2+
import type { ChatInputCommand } from "..";
33
import { getUserDocument } from "../../../database/user";
44
import AccountHandler from "../../../handlers/AccountHandler";
55

66
export default {
77
name: "register",
88
description: "регистрация",
9+
public: true,
910
options: [{
1011
name: "password",
1112
description: "пароль",
@@ -48,4 +49,4 @@ export default {
4849
}]
4950
});
5051
}
51-
} satisfies SecondLevelChatInputCommand;
52+
} satisfies ChatInputCommand;

src/commands/chatInput/account/setpassword.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { ApplicationCommandOptionType } from "discord.js";
2-
import type { SecondLevelChatInputCommand } from "..";
2+
import type { ChatInputCommand } from "..";
33
import { getUserDocument } from "../../../database/user";
44
import AccountHandler from "../../../handlers/AccountHandler";
55

66
export default {
77
name: "setpassword",
88
description: "поставить пароль",
9+
public: true,
910
options: [{
1011
name: "password",
1112
description: "пароль",
@@ -42,4 +43,4 @@ export default {
4243
}]
4344
});
4445
}
45-
} satisfies SecondLevelChatInputCommand;
46+
} satisfies ChatInputCommand;

src/handlers/interactions/chatInputCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function chatInputCommandHandler(interaction: ChatInputCommandInt
99
if (command && hierarchy[2] && "subcommands" in command) command = command.subcommands.find(({ name }) => name === hierarchy[2]);
1010

1111
if (command && "execute" in command) {
12-
if (!command.public && !config.owners.includes(interaction.user.id)) return;
12+
if (!command.public && !config.owners.includes(interaction.user.id)) return void interaction.reply({ content: "Эта команда недоступна для вас", ephemeral: true });
1313
return void command.execute(interaction);
1414
}
1515
}

0 commit comments

Comments
 (0)