From 9f4ae351dbbf5823690654eab98c46eddcd25fa7 Mon Sep 17 00:00:00 2001 From: LenAnderson Date: Tue, 16 Jan 2024 22:37:12 +0000 Subject: [PATCH] fix bools in /qr-update --- .../extensions/quick-reply/src/SlashCommandHandler.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js b/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js index eb1b81733..4fc3cfbb1 100644 --- a/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js +++ b/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js @@ -1,4 +1,5 @@ import { registerSlashCommand } from '../../../slash-commands.js'; +import { isTrueBoolean } from '../../../utils.js'; // eslint-disable-next-line no-unused-vars import { QuickReplyApi } from '../api/QuickReplyApi.js'; @@ -162,11 +163,11 @@ export class SlashCommandHandler { newLabel: args.newlabel, message: (message ?? '').trim().length > 0 ? message : undefined, title: args.title, - isHidden: args.hidden, - executeOnStartup: args.startup, - executeOnUser: args.user, - executeOnAi: args.bot, - executeOnChatChange: args.load, + isHidden: args.hidden === undefined ? undefined : isTrueBoolean(args.hidden), + executeOnStartup: args.startup === undefined ? undefined : isTrueBoolean(args.startup), + executeOnUser: args.user === undefined ? undefined : isTrueBoolean(args.user), + executeOnAi: args.bot === undefined ? undefined : isTrueBoolean(args.bot), + executeOnChatChange: args.load === undefined ? undefined : isTrueBoolean(args.load), }, ); } catch (ex) {