From dd1979caf9d645bc182ab66e6945a0c8317b459a Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Mon, 15 Sep 2025 06:48:25 -0600 Subject: [PATCH] Fix hub id in setup command not appearing lol --- commands/setup.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commands/setup.js b/commands/setup.js index 7deaa03..289a9e3 100644 --- a/commands/setup.js +++ b/commands/setup.js @@ -31,10 +31,9 @@ const execute = async (interaction) => { const shortDescription = "Our super cool product hub!"; const longDescription = "Welcome to our super cool product hub! We offer a variety of awesome products for you to explore and purchase. Enjoy your stay!"; const result = await pool.query('INSERT INTO hubs (ownerId, discordGuild, name, shortDescription, longDescription, secretKey) VALUES (?, ?, ?, ?, ?, ?)', [ownerId, guildId, name, shortDescription, longDescription, await crypto.randomBytes(64).toString('hex')]); - const hub = await pool.query('SELECT * FROM hubs WHERE discordGuild = ?', [guildId]); - console.log(hub) + const [hub] = await pool.query('SELECT * FROM hubs WHERE discordGuild = ?', [guildId]); if (result.affectedRows === 1) { - return interaction.reply({ content: `Hub successfully created with ID: \`${result.insertId}\`. Get details via the /settings command!`, ephemeral: true }); + return interaction.reply({ content: `Hub successfully created with ID: \`${hub.id}\`. Get details via the /settings command!`, ephemeral: true }); } else { return interaction.reply({ content: "An error occurred while creating the hub. Please try again later.", ephemeral: true }); }