From 6e878d1f6afed7abc281c67e06811c3831d9cfa8 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Tue, 11 Aug 2026 23:00:51 -0600 Subject: [PATCH] Add some logging --- commands/update.js | 3 ++- migrations/009_fix_users_utf8mb4.sql | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 migrations/009_fix_users_utf8mb4.sql diff --git a/commands/update.js b/commands/update.js index 6fb8d1d..0a542d6 100644 --- a/commands/update.js +++ b/commands/update.js @@ -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 }); } }; diff --git a/migrations/009_fix_users_utf8mb4.sql b/migrations/009_fix_users_utf8mb4.sql new file mode 100644 index 0000000..149b765 --- /dev/null +++ b/migrations/009_fix_users_utf8mb4.sql @@ -0,0 +1,4 @@ +ALTER TABLE users +MODIFY discordDisplayName VARCHAR(255) +CHARACTER SET utf8mb4 +COLLATE utf8mb4_unicode_ci;