Skip to content

Commit

Permalink
feat($broadCastEval): add error when client shard is not initialised
Browse files Browse the repository at this point in the history
  • Loading branch information
Faf4a committed Nov 29, 2023
1 parent 2c7a408 commit f187fd8
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/functions/client/broadcastEval.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
module.exports = async (d) => {
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);

const [func] = data.inside.splits;
const [func] = data.inside.splits;

function evalfunc(client, {func}) {
return eval(func)
}
function evalfunc(client, { func }) {
return eval(func);
}

data.result = await d.client.shard.broadcastEval(evalfunc, {context: {func: func}});
if (!d.client.shard) return d.aoiError.fnError(d,"custom", {}, "ClientShard Class is Not Initialised");

data.result = data.result.join(" , ");
data.result = await d.client.shard.broadcastEval(evalfunc, {
context: { func: func },
});

return {
code: d.util.setCode(data),
};
};
data.result = data.result.join(" , ");

return {
code: d.util.setCode(data),
};
};

0 comments on commit f187fd8

Please sign in to comment.