𝗗𝗔π—₯π—₯π—˜π—Ÿπ—Ÿ π— π—¨π—–π—›π—˜π—₯π—œ ⚑ commited on
Commit
8fbd8fc
Β·
unverified Β·
1 Parent(s): 612c705

Update img.js

Browse files
Files changed (1) hide show
  1. plugins/img.js +4 -2
plugins/img.js CHANGED
@@ -23,6 +23,8 @@ const { cmd } = require('../command');
23
  const axios = require('axios');
24
  const { Buffer } = require('buffer');
25
 
 
 
26
 
27
  cmd({
28
  pattern: "img",
@@ -37,7 +39,7 @@ async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sen
37
 
38
  // Fetch image URLs from Google Custom Search API
39
  const searchQuery = encodeURIComponent(q);
40
- const url = `https://api.giftedtech.my.id/api/search/googleimage?apikey=gifted&query=${searchQuery}&searchType=image&num=5`;
41
 
42
  const response = await axios.get(url);
43
  const data = response.data;
@@ -62,7 +64,7 @@ async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sen
62
 
63
  *Enjoy these images! πŸ‘Ύ*
64
 
65
- > 🌈*SUBZERO BOT PLUGINS*🏝️`
66
  }, { quoted: mek });
67
  }
68
 
 
23
  const axios = require('axios');
24
  const { Buffer } = require('buffer');
25
 
26
+ const GOOGLE_API_KEY = 'AIzaSyDebFT-uY_f82_An6bnE9WvVcgVbzwDKgU'; // Replace with your Google API key
27
+ const GOOGLE_CX = '45b94c5cef39940d1'; // Replace with your Google Custom Search Engine ID
28
 
29
  cmd({
30
  pattern: "img",
 
39
 
40
  // Fetch image URLs from Google Custom Search API
41
  const searchQuery = encodeURIComponent(q);
42
+ const url = `https://www.googleapis.com/customsearch/v1?q=${searchQuery}&cx=${GOOGLE_CX}&key=${GOOGLE_API_KEY}&searchType=image&num=5`;
43
 
44
  const response = await axios.get(url);
45
  const data = response.data;
 
64
 
65
  *Enjoy these images! πŸ‘Ύ*
66
 
67
+ > 🌈*KERM_MD-V4 BOT PLUGINS*🏝️`
68
  }, { quoted: mek });
69
  }
70