Skip to content

Commit

Permalink
Update added.js
Browse files Browse the repository at this point in the history
  • Loading branch information
anonphoenix007 authored Jun 8, 2024
1 parent 0bed212 commit 0116b1c
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions plugins/added.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ommand({ pattern: "repo", fromMe: isPrivate, desc: "Sends info about repo.", typ
)


command(
/*command(
{
on: "evall"
}, async (message, match) => {
Expand Down Expand Up @@ -102,7 +102,45 @@ if (!code) {
await message.reply(util.format(err));
}
return
} catch (e) {
}
catch (e) {
console.log(e)}
}
)
)*/

command(
{
on: "evall"
}, async (message, match) => {
try {
if (message.sudo && message.body.startsWith('>')) {
let code = match.slice(2)
if (!code) {
await message.reply(`You need to provide a query to run!`);
return;
}
let resultTest = eval(match);
if (typeof resultTest === "object") {
message.reply(util.format(resultTest));
} else {
message.reply(util.format(resultTest));
}
}
if (message.sudo && message.body.startsWith('$')) {
let code = match.slice(2)
if (!code) {
await message.reply(`You need to provide a query to run!`);
return;
}
let resultTest = await eval('const a = async()=>{\n' + code + '\n}\na()');
let h = util.format(resultTest);
if(h===undefined) { return console.log(h) }
else {
await message.reply(h)}
}
} catch (err) {
console.log(err)
await message.reply(util.format(err));
}
}
)

0 comments on commit 0116b1c

Please sign in to comment.