From 0f0de6ce5b38eb7b55ffc5b2a0bedb4973852921 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Tue, 6 Feb 2018 20:59:49 -0800 Subject: [PATCH] fix: force set plugin --- src/command.ts | 6 +++--- src/plugin.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/command.ts b/src/command.ts index 41e68abe..4e1a2eb1 100644 --- a/src/command.ts +++ b/src/command.ts @@ -77,13 +77,13 @@ export namespace Command { load(): Class } - export function toCached(c: Class): Command { + export function toCached(c: Class, plugin: Config.Plugin): Command { return { id: c.id, description: c.description, usage: c.usage, - pluginName: c.plugin && c.plugin.name, - pluginType: c.plugin && c.plugin.type, + pluginName: plugin.name, + pluginType: plugin.type, hidden: c.hidden, aliases: c.aliases || [], examples: c.examples, diff --git a/src/plugin.ts b/src/plugin.ts index 4353b7e7..89e7d22d 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -194,7 +194,7 @@ export class Plugin implements IPlugin { version: this.version, commands: this.commandIDs.map(id => { try { - return [id, Command.toCached(this.findCommand(id, {must: true}))] + return [id, Command.toCached(this.findCommand(id, {must: true}), this)] } catch (err) { this.warn(err, 'toCached') } }) .filter((f): f is [string, Command] => !!f)