Add some logging
This commit is contained in:
parent
e1a982fb96
commit
6e878d1f6a
|
|
@ -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 });
|
||||
}
|
||||
};
|
||||
|
|
|
|||
4
migrations/009_fix_users_utf8mb4.sql
Normal file
4
migrations/009_fix_users_utf8mb4.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
ALTER TABLE users
|
||||
MODIFY discordDisplayName VARCHAR(255)
|
||||
CHARACTER SET utf8mb4
|
||||
COLLATE utf8mb4_unicode_ci;
|
||||
Loading…
Reference in a new issue