Slash Options

Hello! How can I make it so that it displays the list of threads on the server here instead of just regular options?
3 Replies
d.js toolkit
d.js toolkit2d ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Syros
SyrosOP2d ago
Syros
SyrosOP2d ago
I have this error.
UnhandledRejection ReferenceError: ChannelType is not defined
at C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\index.js:92:28
at MixedClass._sharedAddOptionMethod (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\@discordjs\builders\dist\index.js:2439:50)
at MixedClass.addStringOption (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\@discordjs\builders\dist\index.js:2411:17)
at Client.<anonymous> (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\index.js:89:8)
at Client.emit (node:events:536:35)
at WebSocketManager.triggerClientReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:381:17)
at WebSocketManager.checkShardsReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:364:10)
at WebSocketShard.<anonymous> (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:194:16)
at WebSocketShard.emit (node:events:524:28)
at WebSocketShard.checkReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketShard.js:184:12)
UnhandledRejection ReferenceError: ChannelType is not defined
at C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\index.js:92:28
at MixedClass._sharedAddOptionMethod (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\@discordjs\builders\dist\index.js:2439:50)
at MixedClass.addStringOption (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\@discordjs\builders\dist\index.js:2411:17)
at Client.<anonymous> (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\index.js:89:8)
at Client.emit (node:events:536:35)
at WebSocketManager.triggerClientReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:381:17)
at WebSocketManager.checkShardsReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:364:10)
at WebSocketShard.<anonymous> (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:194:16)
at WebSocketShard.emit (node:events:524:28)
at WebSocketShard.checkReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketShard.js:184:12)
UnhandledRejection TypeError: option.setName(...).setDescription(...).addChannelTypes is not a function
at C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\index.js:93:12
at MixedClass._sharedAddOptionMethod (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\@discordjs\builders\dist\index.js:2439:50)
at MixedClass.addStringOption (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\@discordjs\builders\dist\index.js:2411:17)
at Client.<anonymous> (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\index.js:90:8)
at Client.emit (node:events:536:35)
at WebSocketManager.triggerClientReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:381:17)
at WebSocketManager.checkShardsReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:364:10)
at WebSocketShard.<anonymous> (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:194:16)
at WebSocketShard.emit (node:events:524:28)
at WebSocketShard.checkReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketShard.js:184:12)
UnhandledRejection TypeError: option.setName(...).setDescription(...).addChannelTypes is not a function
at C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\index.js:93:12
at MixedClass._sharedAddOptionMethod (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\@discordjs\builders\dist\index.js:2439:50)
at MixedClass.addStringOption (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\@discordjs\builders\dist\index.js:2411:17)
at Client.<anonymous> (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\index.js:90:8)
at Client.emit (node:events:536:35)
at WebSocketManager.triggerClientReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:381:17)
at WebSocketManager.checkShardsReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:364:10)
at WebSocketShard.<anonymous> (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketManager.js:194:16)
at WebSocketShard.emit (node:events:524:28)
at WebSocketShard.checkReady (C:\Users\skyro\Documents\Discord\Programmes\BotProfilsNotifs\node_modules\discord.js\src\client\websocket\WebSocketShard.js:184:12)
I receive that. Like that?
new SlashCommandBuilder()
.setName('deny')
.setDescription('Refuser une suggestion.')
.addChannelOption(option =>
option.setName('thread')
.setDescription('Lien du thread à refuser')
.addChannelTypes(ChannelType.PublicThread)
.setRequired(true))
.addStringOption(option =>
option.setName('raison')
.setDescription('Raison du refus')
.setRequired(true)
.setMinLength(5)), // Définit une longueur minimale de 5 caractères
new SlashCommandBuilder()
.setName('deny')
.setDescription('Refuser une suggestion.')
.addChannelOption(option =>
option.setName('thread')
.setDescription('Lien du thread à refuser')
.addChannelTypes(ChannelType.PublicThread)
.setRequired(true))
.addStringOption(option =>
option.setName('raison')
.setDescription('Raison du refus')
.setRequired(true)
.setMinLength(5)), // Définit une longueur minimale de 5 caractères

Did you find this page helpful?