Skip to content

Commit

Permalink
see backend status
Browse files Browse the repository at this point in the history
  • Loading branch information
artifishvr committed Apr 24, 2024
1 parent 79ba746 commit d83b958
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ client.on("messageCreate", async message => {
return;
}

if (message.content.startsWith("%features")) {
message.reply(`ℹ️ Features\n\n
💬 Text Generation: ${enableLocal ? "Custom Model" : "CharacterAI"}\n
🖼️ Image Recognition: ${await checkImageRecognition() ? "Enabled" : "Disabled"}`);
return;
}

let imageDetails = await imageRecognition(message)

// Send message to CharacterAI
Expand Down Expand Up @@ -173,6 +180,18 @@ async function checkLocal() {
return response;
}

async function checkImageRecognition() {
let response;
const sendchat = new Promise((resolve) => {
backendsocket.emit("imagerecognitionenabled", {}, (val) => {
response = val;
resolve();
});
});
await sendchat;
return response;
}

async function imageRecognition(message) {
if (message.attachments.size > 0 && !backendsocket.disconnected) {
let imageDetails = '';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spongegpt",
"version": "1.28.4",
"version": "1.28.5",
"description": "custom AI chatbot for discord",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit d83b958

Please sign in to comment.