𝗗𝗔𝗥𝗥𝗘𝗟𝗟 𝗠𝗨𝗖𝗛𝗘𝗥𝗜 ⚡ commited on
Commit
817e0a3
·
unverified ·
1 Parent(s): 13b8d40

Update ai-gemini.js

Browse files
Files changed (1) hide show
  1. plugins/ai-gemini.js +25 -1
plugins/ai-gemini.js CHANGED
@@ -16,7 +16,30 @@
16
  ╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺*/
17
 
18
 
19
- const axios = require('axios');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  const config = require('../config');
21
  const { cmd, commands } = require('../command');
22
 
@@ -49,3 +72,4 @@ ${response.data.message}
49
  return reply("⚠️ An error occurred while fetching AI response. Please try again later.");
50
  }
51
  });
 
 
16
  ╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺╺*/
17
 
18
 
19
+
20
+ const config = require('../config')
21
+ const {cmd , commands} = require('../command')
22
+ const { fetchJson } = require('../lib/functions')
23
+
24
+ cmd({
25
+ pattern: "gemini",
26
+ alias: ["hi","sub"],
27
+ react: "🧠",
28
+ desc: "ai chat.",
29
+ category: "main",
30
+ filename: __filename
31
+ },
32
+ async(conn, mek, m,{from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply}) => {
33
+ try{
34
+ let data = await fetchJson(`https://api.gifted.my.id/api/ai/gpt4?apikey=gifted&q=${q}`)
35
+ return reply(`${data.data}`)
36
+ }catch(e){
37
+ console.log(e)
38
+ reply(`${e}`)
39
+ }
40
+ })
41
+
42
+ /* const axios = require('axios');
43
  const config = require('../config');
44
  const { cmd, commands } = require('../command');
45
 
 
72
  return reply("⚠️ An error occurred while fetching AI response. Please try again later.");
73
  }
74
  });
75
+ */