This commit is contained in:
1tzEmerald committed 2024-07-09 22:49:49 +01:00
1 parent fd65d0a9a7
commit 9a6eece7a1
20 files changed
+902 -376

No files matched your search

+14 -2
View File
@@ -85,10 +85,22 @@ class Client extends Discord.Client {
tempCommandFiles = tempCommandFiles.filter(item => item !== "Ping.js");
}
if (supportbot.Ticket.ClaimTickets.Enabled === false) {
tempCommandFiles = tempCommandFiles.filter(item => item !== "ticketstats.js");
if (cmdconfig.AddUser.Enabled === false) {
tempCommandFiles = tempCommandFiles.filter(item => item !== "addUser.js");
}
if (cmdconfig.RemoveUser.Enabled === false) {
tempCommandFiles = tempCommandFiles.filter(item => item !== "removeUser.js");
}
if (cmdconfig.ForceAddUser.Enabled === false) {
tempCommandFiles = tempCommandFiles.filter(item => item !== "forceaddUser.js");
}
if (cmdconfig.Profile.Enabled === false) {
tempCommandFiles = tempCommandFiles.filter(item => item !== "Profile.js");
}
const commandFiles = tempCommandFiles;
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
+33
View File
@@ -0,0 +1,33 @@
const fs = require("fs");
const yaml = require("js-yaml");
const axios = require("axios");
const supportbotai = yaml.load(fs.readFileSync("./Configs/supportbot-ai.yml", "utf8"));
async function generateImage(prompt, negativePrompt, cfgScale) {
try {
const response = await axios.post('https://api.pepperai.xyz/generate', {
prompt: prompt,
negativePrompt: negativePrompt,
cfgScale: cfgScale
}, {
headers: {
'Authorization': `Bearer ${supportbotai.General.PepperAI_Key}`,
'Content-Type': 'application/json'
}
});
console.log('PepperAI Response:', response.data); // Log the entire response for debugging
if (response.data && response.data.imageUrl) {
return response.data.imageUrl;
} else {
throw new Error(`Invalid response structure: ${JSON.stringify(response.data)}`);
}
} catch (error) {
console.error('PepperAI Image Generation Error:', error);
throw error;
}
}
module.exports = generateImage;