diff --git a/diction/plugin.json b/diction/plugin.json index fb3a532..2abf437 100644 --- a/diction/plugin.json +++ b/diction/plugin.json @@ -2,7 +2,7 @@ "main": "plugin.js", "name": "diction", "description": "Find definitions for words", - "version": "1.2.1", + "version": "1.2.2", "tags": ["commands", "utility", "dictionary"], "dependencies": ["simplecommands"], "npmDependencies": [] diff --git a/diction/plugin.ts b/diction/plugin.ts index 84cc2f4..cd73d09 100644 --- a/diction/plugin.ts +++ b/diction/plugin.ts @@ -160,9 +160,11 @@ class DictionPlugin extends Plugin { lastTime: Date.now(), } ], - definitions: (response as Record[]).map(({ partOfSpeech, text }) => ({ - partOfSpeech, text: text.replace(/(<([^>]+)>)/ig, '') - })), + definitions: (response as Record[]) + .filter(entry => entry.text) + .map(({ partOfSpeech, text }) => ({ + partOfSpeech, text: text.replace(/(<([^>]+)>)/ig, '') + })), inserted: Date.now(), } @@ -182,7 +184,7 @@ class DictionPlugin extends Plugin { return true; }, match: /define (\w*)/, - aliases: ['df'], + aliases: ['df', 'word'], description: 'Find definitions for words. Call again to advance to next definition', usage: '' }); diff --git a/squeebot.repo.json b/squeebot.repo.json index 64c7091..1272954 100644 --- a/squeebot.repo.json +++ b/squeebot.repo.json @@ -11,7 +11,7 @@ }, { "name": "diction", - "version": "1.2.1" + "version": "1.2.2" }, { "name": "fun",