From c8c887ea8320596feb758bacab423e8df8782909 Mon Sep 17 00:00:00 2001 From: ale Date: Sun, 8 Jun 2025 04:03:16 +0200 Subject: [PATCH] /search logs Signed-off-by: ale --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index fcab9e3..db1b11d 100644 --- a/index.js +++ b/index.js @@ -430,6 +430,8 @@ function stopBitcoinMonitoring() { client.on(Events.InteractionCreate, async interaction => { if (!interaction.isChatInputCommand()) return; + console.log(`Command received: ${interaction.commandName}`); + try { switch (interaction.commandName) { case 'ping': @@ -455,16 +457,22 @@ client.on(Events.InteractionCreate, async interaction => { break; case 'search': + console.log('Search command received'); await interaction.deferReply(); const query = interaction.options.getString('query'); const mediaType = interaction.options.getString('type'); const count = interaction.options.getInteger('count') || 3; + console.log(`Search parameters: query="${query}", type="${mediaType}", count=${count}`); + try { if (mediaType === 'image') { + console.log('Processing image search...'); // Enhanced image search with better filtering const searchTerm = `${query} filetype:jpg OR filetype:png OR filetype:gif OR filetype:webp`; + console.log(`Search term: ${searchTerm}`); const results = await googleIt({ query: searchTerm, limit: count * 3 }); + console.log(`Got ${results.length} results from google-it`); const imageResults = []; for (const result of results) {