Slash command options

Why my slash command option dont have getSubcommand or getSubcommandGroup, etc...
8 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Syjalo
Syjalo2y ago
ChatInputCommandInteraction is for slash commands CommandInteraction is for any type of commands
#ToiYeuSweetLiquor <3
ok lemme try it
#ToiYeuSweetLiquor <3
I change class SlashCommandBuilder in my index.ts to this:
export type CommandInteraction = Discord.ChatInputCommandInteraction | Discord.MessageContextMenuCommandInteraction | Discord.UserContextMenuCommandInteraction
export class SlashCommandBuilder extends Discord.SlashCommandBuilder {
run: (interaction: CommandInteraction, client?: Oggy) => Callback<void>
autocompleteRun: (interaction: Discord.AutocompleteInteraction, client?: Oggy) => Callback<void>
constructor() {
super()
this.setName('name')
this.setDescription('description')
this.setDMPermission(false)
}
setRun(run: (interaction: CommandInteraction, client?: Oggy) => Callback<void>) { this.run = run; return this; }
setAutocompleteRun(run: (interaction: Discord.AutocompleteInteraction, client?: Oggy) => Callback<void>) { this.autocompleteRun = run; return this; }
}
export type CommandInteraction = Discord.ChatInputCommandInteraction | Discord.MessageContextMenuCommandInteraction | Discord.UserContextMenuCommandInteraction
export class SlashCommandBuilder extends Discord.SlashCommandBuilder {
run: (interaction: CommandInteraction, client?: Oggy) => Callback<void>
autocompleteRun: (interaction: Discord.AutocompleteInteraction, client?: Oggy) => Callback<void>
constructor() {
super()
this.setName('name')
this.setDescription('description')
this.setDMPermission(false)
}
setRun(run: (interaction: CommandInteraction, client?: Oggy) => Callback<void>) { this.run = run; return this; }
setAutocompleteRun(run: (interaction: Discord.AutocompleteInteraction, client?: Oggy) => Callback<void>) { this.autocompleteRun = run; return this; }
}
and nothing change
Syjalo
Syjalo2y ago
Discord.ChatInputCommandInteraction | Discord.MessageContextMenuCommandInteraction | Discord.UserContextMenuCommandInteraction this still represents not only slash command interaction. Context menu interactions doesn't have string, number, etc options.
#ToiYeuSweetLiquor <3
I got it, thanks alot

Did you find this page helpful?