diff --git a/debug/plugin.ts b/debug/plugin.ts index cb55598..e6c9893 100644 --- a/debug/plugin.ts +++ b/debug/plugin.ts @@ -20,7 +20,7 @@ function addCommands(plugin: UtilityPlugin, commands: any): void { if (!simplified[0]) { return true; } - const script = msg.data.split(' ').slice(1).join(' '); + const script = simplified.join(' '); // Disallow child_process when shell is disallowed if ((script.indexOf('child_process') !== -1 || diff --git a/diction/plugin.ts b/diction/plugin.ts index d643683..8e300a3 100644 --- a/diction/plugin.ts +++ b/diction/plugin.ts @@ -67,7 +67,7 @@ class DictionPlugin extends Plugin { pos = ''; } - const word = encodeURIComponent(msg.text.split(' ').slice(pos ? 2 : 1).join(' ')); + const word = encodeURIComponent(simplified.slice(pos ? 1 : 0).join(' ')); if (!word) { msg.resolve('Please specifiy a word or term!'); @@ -111,6 +111,7 @@ class DictionPlugin extends Plugin { msg.resolve(str); return true; }, + match: /define (\w*)/, aliases: ['df'], description: 'Find definitions for words', usage: '[] ' diff --git a/fun/plugin.ts b/fun/plugin.ts index e8db1bd..4181cb4 100644 --- a/fun/plugin.ts +++ b/fun/plugin.ts @@ -61,7 +61,10 @@ class FunPlugin extends Plugin { name: 'hug', plugin: this.name, execute: async (msg: IMessage): Promise => { - msg.resolve(msg.source.format.format('action', 'hugs %s'), msg.sender?.name); + if (!msg.sender) { + return true; + } + msg.resolve(msg.source.format.format('action', 'hugs %s'), msg.mention(msg.sender)); return true; }, hidden: true