Fix panel categories field

This commit is contained in:
Isaac 2021-05-11 23:32:26 +01:00
parent 07147cdeb3
commit f9b552e1d0
No known key found for this signature in database
GPG Key ID: F6812DBC6719B4E3

View File

@ -94,6 +94,8 @@ module.exports = class PanelCommand extends Command {
let panel_channel, let panel_channel,
panel_message; panel_message;
let emoji_map = args[arg_categories];
let embed = new MessageEmbed() let embed = new MessageEmbed()
.setColor(settings.colour) .setColor(settings.colour)
.setFooter(settings.footer, message.guild.iconURL()); .setFooter(settings.footer, message.guild.iconURL());
@ -160,10 +162,10 @@ module.exports = class PanelCommand extends Command {
await panel_message.react(args[arg_emoji][0]); await panel_message.react(args[arg_emoji][0]);
} else { } else {
// multi category // multi category
let emoji_map = {};
let description = ''; let description = '';
emoji_map = {};
for (let i in args[arg_emoji]) { for (let i in args[arg_emoji]) {
emoji_map[args[arg_emoji][i]] = args[arg_categories][i]; emoji_map[args[arg_emoji][i]] = args[arg_categories][i];
let cat_row = await this.client.db.models.Category.findOne({ 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}`); message.channel.send(`${panel_channel}`);
await this.client.db.models.Panel.create({ await this.client.db.models.Panel.create({
categories: args[arg_categories], categories: emoji_map,
channel: panel_channel.id, channel: panel_channel.id,
guild: message.guild.id, guild: message.guild.id,
message: panel_message.id, message: panel_message.id,