Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #51 from mrepol742/master
Browse files Browse the repository at this point in the history
Initial Commit
  • Loading branch information
mrepol742 authored Feb 1, 2024
2 parents a3d0990 + f244af6 commit 16e5298
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,6 @@ async function ai22(api, event, query, query2) {
let eventB = event.body;
let input = eventB.normalize("NFKC");

const login = api.getCurrentUserID();

if (settings.shared.quiz) {
for (q in settings.shared.quiz) {
if (settings.shared.quiz[q].messageID && event.messageReply.messageID == settings.shared.quiz[q].messageID) {
Expand Down Expand Up @@ -2024,7 +2022,33 @@ async function ai(api, event) {
}
});
}
} else if ((findPr != false && input.startsWith(findPr)) || testCommand(api, query2, "mj", event.senderID || testCommand(api, query2, "beshy", event.senderID))) {
} else if (testCommand(api, query2, "bb", event.senderID)) {
if (isGoingToFast(api, event)) {
return;
}
let data = input.split(" ");
if (data.length < 2) {
sendMessage(api, event, hey[Math.floor(Math.random() * hey.length)]);
} else {
data.shift();
const url = "https://useblackbox.io/chat-request-v4";
const prompt = data.join(" ");
const requestData = {
textInput: prompt,
allMessages: [{ user: "You are `bb` a generative AI! You will output concise response in 1 paragraph 3 sentences and you can use emojis too. Here is the question: " + prompt }],
stream: "",
clickedContinue: false,
};

try {
const response = await axios.post(url, requestData);
let message = response.data.response[0][0];
sendMessage(api, event, message);
} catch (err) {
sendMessage(api, event, handleError({ stacktrace: err, cuid: api.getCurrentUserID(), e: event }));
}
}
} else if ((findPr != false && input.startsWith(findPr)) || testCommand(api, query2, "mj", event.senderID) || testCommand(api, query2, "beshy", event.senderID)) {
if (isGoingToFast(api, event)) {
return;
}
Expand Down Expand Up @@ -3635,7 +3659,7 @@ async function ai(api, event) {
data.shift();
getResponseData("https://api-baybayin-transliterator.vercel.app/?text=" + data.join(" ")).then((response) => {
if (response == null) return sendMessage(api, event, handleError({ stacktrace: response, cuid: api.getCurrentUserID(), e: event }));
sendMessage(api, event, response.baybay);
sendMessage(api, event, response.baybayin);
});
}
} else if (testCommand(api, query2, "doubleStruck", event.senderID)) {
Expand Down Expand Up @@ -6203,7 +6227,7 @@ async function ai(api, event) {
if (!messageInfo.messageID) return utils.logged("undefined messageinfo.messageID");

settings.shared.quiz.push({ uid: event.senderID, correctAnswer: answer, correctAnswer1: cAA, messageID: messageInfo.messageID, time: new Date().toISOString() });

await sleep(60000);
for (q in settings.shared.quiz) {
if (messageInfo.messageID == settings.shared.quiz[q].messageID && settings.shared.quiz[q].timeout) {
Expand Down

0 comments on commit 16e5298

Please sign in to comment.