File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
commands/chatInput/account Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,5 @@ const accountSubcommands = readdirSync(__dirname)
88export default {
99 name : "account" ,
1010 description : "аккаунт" ,
11- public : true ,
1211 subcommands : accountSubcommands
1312} satisfies FirstLevelChatInputCommand ;
Original file line number Diff line number Diff line change 11import { ApplicationCommandOptionType } from "discord.js" ;
2- import type { SecondLevelChatInputCommand } from ".." ;
2+ import type { ChatInputCommand } from ".." ;
33import { getUserDocument } from "../../../database/user" ;
44import AccountHandler from "../../../handlers/AccountHandler" ;
55
66export 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 ;
Original file line number Diff line number Diff line change 11import { ApplicationCommandOptionType } from "discord.js" ;
2- import type { SecondLevelChatInputCommand } from ".." ;
2+ import type { ChatInputCommand } from ".." ;
33import { getUserDocument } from "../../../database/user" ;
44import AccountHandler from "../../../handlers/AccountHandler" ;
55
66export 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 ;
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments