Add "Did You Mean" to define when necessary

This commit is contained in:
Dragon Fire
2019-07-24 19:50:58 -04:00
parent ab26b5c89b
commit bd9ef97a99
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -35,6 +35,7 @@ module.exports = class DefineCommand extends Command {
.query({ key: WEBSTER_KEY });
if (!body.length) return msg.say('Could not find any results.');
const data = body[0];
if (typeof data === 'string') return msg.say(`Could not find any results. Did you mean **${data}**?`);
return msg.say(stripIndents`
**${data.meta.stems[0]}** (${data.fl})
${data.shortdef.map((definition, i) => `(${i + 1}) ${definition}`).join('\n')}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "107.3.0",
"version": "107.3.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {