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

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrepol742 committed Oct 15, 2023
1 parent 6ac1386 commit 17f9684
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
20 changes: 10 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const utils = require("./src/redfox/utils.js");
const redfox = require("./src/redfox");
const welcomejs = require("./src/welcome.js");
const cp = require("child_process");
const { exec } = require("child_process");
const fs = require("fs");


Expand Down Expand Up @@ -2662,7 +2662,7 @@ async function ai(api, event) {
} else {
data.shift();
let font = asciifonts[Math.floor(Math.random() * asciifonts.length)];
cp.execSync("cd src/ascii && figlet -f " + font + " " + data.join(" "), function (err, stdout, stderr) {
exec("cd src/ascii && figlet -f " + font + " " + data.join(" "), function (err, stdout, stderr) {
sendMessage(api, event, stdout + "\n\n" + stderr);
});
}
Expand All @@ -2679,7 +2679,7 @@ async function ai(api, event) {
let font = aa[0].toLowerCase();
if (asciifonts.includes(aa[0])) {
aa.shift();
cp.execSync("cd src/ascii && figlet -f " + font + " " + aa.join(" "), function (err, stdout, stderr) {
exec("cd src/ascii && figlet -f " + font + " " + aa.join(" "), function (err, stdout, stderr) {
sendMessage(api, event, stdout + "\n\n" + stderr);
});
} else {
Expand Down Expand Up @@ -2732,7 +2732,7 @@ async function ai(api, event) {
} else {
data.shift();
let aa = data.join(" ");
cp.execSync("curl -I " + aa, function (err, stdout, stderr) {
exec("curl -I " + aa, function (err, stdout, stderr) {
sendMessage(api, event, stdout + "\n\n" + stderr);
});
}
Expand All @@ -2746,7 +2746,7 @@ async function ai(api, event) {
} else {
data.shift();
let aa = data.join(" ");
cp.execSync("nslookup " + aa, function (err, stdout, stderr) {
exec("nslookup " + aa, function (err, stdout, stderr) {
sendMessage(api, event, stdout + "\n\n" + stderr);
});
}
Expand All @@ -2760,7 +2760,7 @@ async function ai(api, event) {
} else {
data.shift();
let aa = data.join(" ");
cp.execSync("ping -c 5 " + aa, function (err, stdout, stderr) {
exec("ping -c 5 " + aa, function (err, stdout, stderr) {
sendMessage(api, event, stdout + "\n\n" + stderr);
});
}
Expand All @@ -2774,7 +2774,7 @@ async function ai(api, event) {
} else {
data.shift();
let aa = data.join(" ");
cp.execSync("traceroute " + aa, function (err, stdout, stderr) {
exec("traceroute " + aa, function (err, stdout, stderr) {
let com = stderr.replace(/\s+/g, "");
if (com == "") {
traceroute["/" + aa] = stdout;
Expand Down Expand Up @@ -3998,7 +3998,7 @@ async function ai(api, event) {
}
} else if (query == "sync") {
if (isMyId(event.senderID)) {
cp.execSync("git pull", function (err, stdout, stderr) {
exec("git pull", function (err, stdout, stderr) {
sendMessage(api, event, stdout + "\n\n" + stderr);
});
}
Expand Down Expand Up @@ -4033,7 +4033,7 @@ async function ai(api, event) {
sendMessage(api, event, "Opps! Houston, we have a problem! You should try using git code instead." + "\n\n" + example[Math.floor(Math.random() * example.length)] + "\ngit add .");
} else {
data.shift();
cp.execSync("git " + data.join(" "), function (err, stdout, stderr) {
exec("git " + data.join(" "), function (err, stdout, stderr) {
let str = stdout + "\n\n" + stderr;
let com = str.replaceAll(/\s+/g, "");
if (com == "") {
Expand Down Expand Up @@ -7949,7 +7949,7 @@ function isMyPrefix(findPr, input, query, query2) {
return true;
}
return (
(settings.preference.prefix != "" && query.startsWith(settings.preference.prefix)) || /(^melvin$|^melvin\s|^mj$|^mj\s|^mrepol742$|^mrepol742\s|^ai$|^ai\s|^gpt$|^gpt\s|^ask$|^ask\s|^beshy$|^beshy\s|^beshie$|^beshie\s)/.test(query2)
(settings.preference.prefix != "" && query.startsWith(settings.preference.prefix)) || /(^melvin$|^melvin\s|^mj$|^mj\s|^beshy$|^beshy\s|^beshie$|^beshie\s)/.test(query2)
// || isSecondaryPrefix(query2.replaceAll("'", "").replaceAll("`", ""))
);
}
Expand Down
7 changes: 7 additions & 0 deletions src/test1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const { execFile } = require('child_process');
const child = execFile('node', ['--version'], (error, stdout, stderr) => {
if (error) {
throw error;
}
console.log(stdout);
});

0 comments on commit 17f9684

Please sign in to comment.