/search logs
Signed-off-by: ale <ale@manalejandro.com>
This commit is contained in:
parent
a9420500af
commit
c8c887ea83
8
index.js
8
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user