Limit Search Results to 5

This commit is contained in:
Raven 2024-08-03 16:27:17 -04:00
parent e25557190c
commit ae82fda49f

View File

@ -431,8 +431,14 @@ if (searchMatch) {
const searchQuery = searchMatch[1]; const searchQuery = searchMatch[1];
console.log(`${getTimestamp()} [INFO] Detected search query in user message: ${searchQuery}`); console.log(`${getTimestamp()} [INFO] Detected search query in user message: ${searchQuery}`);
const options = {
query: searchQuery,
limit: 5,
disableConsole: true
};
try { try {
googleIt({ 'query': searchQuery }).then(async results => { googleIt(options).then(async results => {
let searchResponse = `Search Query: ${searchQuery}\n`; let searchResponse = `Search Query: ${searchQuery}\n`;
searchResponse += `Top Google search results:\n`; searchResponse += `Top Google search results:\n`;