mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add "Did You Mean" to define when necessary
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "107.3.0",
|
||||
"version": "107.3.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user