From 793119dfc9c3cf5e8b4ecd967b1c12f9987bfc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Gro=C3=9F?= Date: Thu, 16 Mar 2023 00:59:59 +0100 Subject: [PATCH] Wishlist: Fix TypeError on initial wishlist creation On creation Characters are not included. Since a new wishlist is empty anyway, we attach an empty array manually. --- commands/wishlist.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/wishlist.js b/commands/wishlist.js index 8a85242..0fbb67d 100644 --- a/commands/wishlist.js +++ b/commands/wishlist.js @@ -43,9 +43,10 @@ module.exports = { if(!wishlist) { wishlist = await Wishlist.create({ ping: false, - UserId: user.id + UserId: user.id, }); - interaction.channel.send("Created new wishlist"); + wishlist.Characters = [] + await interaction.channel.send("Created new wishlist"); } switch (interaction.options.getSubcommand()) { case "view":