Spaces:
Paused
Paused
File size: 1,355 Bytes
9b24c74 5846f1b 9b24c74 231eeee 513f6bd 231eeee 513f6bd 231eeee 513f6bd 9b24c74 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
/*
Hey Cloner Make This Work
Yours DUDAS
const axios = require('axios');
const config = require('../config');
const { cmd, commands } = require('../command');
cmd({
pattern: "bot",
alias: ["geminai","gpt"],
react: "π€",
desc: "AI chat.",
category: "main",
filename: __filename
}, 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
}) => {
try {
if (!q) return reply("Please ask a question or provide input for the AI.");
const userInput = q.trim();
if (userInput === "") return reply("Please provide a valid input.");
const apiUrl = `https://api.giftedtech.web.id/api/ai/geminiaipro?apikey=gifted&q=${encodeURIComponent(userInput)}`;
const response = await axios.get(apiUrl);
console.log('API Response:', response.data);
if (!response.data || !response.data.message) {
return reply("No response from the AI or invalid API response.");
}
const aiResponse = response.data.message.trim();
return reply(`\`π€ GEMINI AI RESPONSE:\` \n\n${aiResponse}`);
} catch (error) {
console.error('Error:', error);
reply(`An error occurred: ${error.message}`);
}
});
*/
|