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
25 lines (15 loc) • 562 B
JavaScript
const embed = require("../../handlers/errors");
module.exports = async (d) => {
const code = d.command.code;
const inside = d.unpack();
const err = d.inside(inside);
if (err) return d.error(err);
let [userID, ...msg] = inside.splits;
msg = msg.join(";");
const user = await d.client.users.fetch(userID).catch((err) => {});
if (!user) return d.error(`:x: Invalid user ID in \`$sendDM${inside}\``);
const options = await embed(d, msg, undefined, user);
return {
code: code.replaceLast(`$sendDM${inside}`, ""),
};
}; // it works?