From 6534c520fb2a9c97c9460305713e8ed78bbfec36 Mon Sep 17 00:00:00 2001 From: Cat++ <69035887+NotGhex@users.noreply.github.com> Date: Sat, 18 Nov 2023 10:44:19 +0800 Subject: [PATCH] use defaultsDeep --- packages/core/src/classes/managers/CommandManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/classes/managers/CommandManager.ts b/packages/core/src/classes/managers/CommandManager.ts index ce8d40a5..6147046f 100644 --- a/packages/core/src/classes/managers/CommandManager.ts +++ b/packages/core/src/classes/managers/CommandManager.ts @@ -7,7 +7,7 @@ import { MessageCommandBuilder, MessageCommandExecuteData } from '../builders/Me import { RecipleClient } from '../structures/RecipleClient'; import { CommandType } from '../../types/constants'; import { Utils } from '../structures/Utils'; -import { merge } from 'lodash'; +import { defaultsDeep } from 'lodash'; export interface CommandManagerRegisterCommandsOptions extends Omit, 'enabled'> { contextMenuCommands?: Partial & { @@ -146,7 +146,7 @@ export class CommandManager { public async registerApplicationCommands(options?: CommandManagerRegisterCommandsOptions): Promise<{ global: Collection; guilds: Collection> }> { const store = { global: new Collection(), guilds: new Collection>() }; - const config = merge({ ...this.client.config.commands, ...this.client.config.applicationCommandRegister }, options) as CommandManagerRegisterCommandsOptions; + const config = defaultsDeep({ ...this.client.config.commands, ...this.client.config.applicationCommandRegister }, options) as CommandManagerRegisterCommandsOptions; const contextMenuCommands = (options?.contextMenuCommands?.commands ?? Array.from(this.contextMenuCommands.values())).map(c => isJSONEncodable(c) ? c.toJSON() : c); const slashCommands = (options?.slashCommands?.commands ?? Array.from(this.slashCommands.values())).map(c => isJSONEncodable(c) ? c.toJSON() : c);