This commit is contained in:
Christopher Cookman 2025-09-15 06:46:23 -06:00
parent d0957f7edd
commit 3d65e01a78

View file

@ -31,7 +31,8 @@ const execute = async (interaction) => {
const shortDescription = "Our super cool product hub!"; 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 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 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')]);
console.log(result) const hub = await pool.query('SELECT * FROM hubs WHERE discordGuild = ?', [guildId]);
console.log(hub)
if (result.affectedRows === 1) { 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: \`${result.insertId}\`. Get details via the /settings command!`, ephemeral: true });
} else { } else {