dbd.js-new
Version:
dbd.js-new - Simplifica la programación de un bot de discord, dbd.js-new es una versión de dbd.js con soporte
22 lines (14 loc) • 527 B
JavaScript
const setChannelVar = async (d) => {
const code = d.command.code;
const inside = d.unpack();
const err = d.inside(inside);
if (err) return d.error(err);
const [variable, value, channelID = d.message.channel.id] = inside.splits;
if (d.client.variables[variable] === undefined)
return d.error(`❌ Variable '${variable}' not found`);
d.client.db.set("main", `${variable}_${channelID}`, value);
return {
code: code.replaceLast(`$setChannelVar${inside}`, ""),
};
};
module.exports = setChannelVar;