Fractal Pixel
Fractal Pixel
DIAdiscord.js - Imagine an app
Created by Fractal Pixel on 2/20/2025 in #djs-questions
Regex error when setting name of subcommand integer option
Hey. I'm trying to set the name of a subcommand option, yet I get this weird regex error from doing so that I haven't quite figured out yet. Any thoughts? See comments for error. Related code snippet:
const data = new SlashCommandBuilder()
.setName("lobby")
.setDescription("Lets you make or join a lobby!")
.addSubcommand(subcommand =>
subcommand
.setName("new")
.setDescription("Creats a new lobby!")
)
.addSubcommand(subcommand =>
subcommand
.setName("join")
.setDescription("Lets you join a lobby!")
.addIntegerOption(option =>
option
.setName("ID") // This is where the error gets thrown out.
.setDescription("ID of the lobby you wish to join.")
.setMinValue(1)
.setRequired(true)
)
)
const data = new SlashCommandBuilder()
.setName("lobby")
.setDescription("Lets you make or join a lobby!")
.addSubcommand(subcommand =>
subcommand
.setName("new")
.setDescription("Creats a new lobby!")
)
.addSubcommand(subcommand =>
subcommand
.setName("join")
.setDescription("Lets you join a lobby!")
.addIntegerOption(option =>
option
.setName("ID") // This is where the error gets thrown out.
.setDescription("ID of the lobby you wish to join.")
.setMinValue(1)
.setRequired(true)
)
)
6 replies