From f9b552e1d0ba9a576e82a030b474b71917ac1065 Mon Sep 17 00:00:00 2001 From: Isaac Date: Tue, 11 May 2021 23:32:26 +0100 Subject: [PATCH] Fix panel `categories` field --- src/commands/panel.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/commands/panel.js b/src/commands/panel.js index f36c67c..bc6e635 100644 --- a/src/commands/panel.js +++ b/src/commands/panel.js @@ -94,6 +94,8 @@ module.exports = class PanelCommand extends Command { let panel_channel, panel_message; + let emoji_map = args[arg_categories]; + let embed = new MessageEmbed() .setColor(settings.colour) .setFooter(settings.footer, message.guild.iconURL()); @@ -160,10 +162,10 @@ module.exports = class PanelCommand extends Command { await panel_message.react(args[arg_emoji][0]); } else { // multi category - - let emoji_map = {}; let description = ''; + emoji_map = {}; + for (let i in args[arg_emoji]) { emoji_map[args[arg_emoji][i]] = args[arg_categories][i]; let cat_row = await this.client.db.models.Category.findOne({ @@ -192,7 +194,7 @@ module.exports = class PanelCommand extends Command { message.channel.send(`✅ ${panel_channel}`); await this.client.db.models.Panel.create({ - categories: args[arg_categories], + categories: emoji_map, channel: panel_channel.id, guild: message.guild.id, message: panel_message.id,