missing return

This commit is contained in:
Flummi 2017-11-29 17:15:56 +01:00
parent 42b8c30fcb
commit 5170362e7d

View File

@ -13,9 +13,9 @@ module.exports = bot => {
rp(`${url}?term=${term}`, { json: true }).then(data => {
if(data.result_type === "no_results")
e.reply("Term not found");
return e.reply("Term not found");
if(!data.list[index-1])
e.reply("Index not found");
return e.reply("Index not found");
const res = data.list[index-1];
e.reply(`[${index}/${data.list.length}] [b]${res.word}[/b]: ${res.definition.replace(/\r\n/g, "")} - ${res.example.replace(/\r\n/g, "")}`);