File size: 1,345 Bytes
2821330 |
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 |
const axios = require("axios");
module.exports.config = {
name: "ds",
hasPermission: 0,
version: "1.0.0",
commandCategory: "AI",
description: "Interact with the Deepseek AI API",
usePrefix: false,
credits: "Jonell Magallanes",
cooldowns: 10
};
module.exports.run = async function ({ api, event, args }) {
const query = args.join(" ");
const senderID = event.senderID;
if (!query) {
return api.sendMessage("β Please provide a query!", event.threadID, event.messageID);
//const l = await api.sendMessage("Seeking the Answer......", event.threadID, event.messageID);
}
const l = await api.sendMessage("Seeking the Answer......", event.threadID, event.messageID);
try {
const response = await axios.get(`https://ccprojectsapis.zetsu.xyz/api/deepseek?ask=${encodeURIComponent(query)}&id=${event.senderID}`);
const data = response.data;
if (data.message) {
api.editMessage(`ππ²π²π½ππ²π²πΈ ππ\nββββββββββββββββββ\n${data.message}`, l.messageID, event.threadID, event.messageID);
} else {
api.editMessage("β οΈ | No response received from the Deepseek AI.", l.messageID, event.threadID, event.messageID);
}
} catch (error) {
api.editMessage(`β | ${error.message}`, l.messageID, event.threadID, event.messageID);
}
}; |