/search logs

Signed-off-by: ale <ale@manalejandro.com>
This commit is contained in:
ale 2025-06-08 04:03:16 +02:00
parent a9420500af
commit c8c887ea83
Signed by: ale
GPG Key ID: 244A9C4DAB1C0C81

View File

@ -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) {