fixing DDG default messages
This commit is contained in:
@@ -12,8 +12,6 @@ module.exports = {
|
|||||||
var question = encodeURIComponent(args.join(" "));
|
var question = encodeURIComponent(args.join(" "));
|
||||||
|
|
||||||
var answerData = await libFlayer.getAnswer(question);
|
var answerData = await libFlayer.getAnswer(question);
|
||||||
message.reply(`${answerData.text}`);
|
message.reply(`${answerData.text} - ${answerData.source}`);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -212,7 +212,7 @@ exports.getAnswer = async function (question) {
|
|||||||
var answerURL = `https://api.duckduckgo.com/?q=${question}&format=json&pretty=1`;
|
var answerURL = `https://api.duckduckgo.com/?q=${question}&format=json&pretty=1`;
|
||||||
console.log(answerURL);
|
console.log(answerURL);
|
||||||
answerData = {
|
answerData = {
|
||||||
text: ``,
|
text: `No answer found try using a simpler search term`,
|
||||||
source: ``
|
source: ``
|
||||||
}
|
}
|
||||||
await axios.get(answerURL)
|
await axios.get(answerURL)
|
||||||
|
|||||||
Reference in New Issue
Block a user