Add some logging

This commit is contained in:
Christopher Cookman 2026-08-11 23:00:51 -06:00
parent e1a982fb96
commit 6e878d1f6a
2 changed files with 6 additions and 1 deletions

View file

@ -15,6 +15,7 @@ const execute = async (interaction) => {
if (!hub) return interaction.reply({ content: "Hub not found for this guild", ephemeral: true });
const productName = interaction.options.getString("name");
console.log(`Hub is ${hub}`)
const [product] = await pool.query('SELECT * FROM products WHERE UPPER(name) LIKE ? AND hubId = ?', [`%${productName.toUpperCase()}%`, hub.id]);
if (!product) return interaction.reply({ content: "Product not found", ephemeral: true });
// Proceed with creation
@ -73,7 +74,7 @@ const execute = async (interaction) => {
global.dmHandlers[interaction.user.id] = updateProductHandler;
} catch (err) {
console.error(err);
delete global.productCreationData[interaction.user.id];
if(global.productCreationData[interaction.user.id]) delete global.productCreationData[interaction.user.id];
return interaction.editReply({ content: "An error occurred during the product creation process.", ephemeral: true });
}
};

View file

@ -0,0 +1,4 @@
ALTER TABLE users
MODIFY discordDisplayName VARCHAR(255)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;