UNPKG

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

40 lines (34 loc) 974 B
const interpreter = require("../interpreter"); module.exports = async (client, channel, user) => { for (const command of client.typing_commands.array()) { const data = { author: user, member: channel.type === "dm" ? undefined : await channel.guild.members .fetch(user.id) .catch((err) => undefined), guild: channel.guild, channel, }; const id = command.channel ? command.channel.includes("$") ? await interpreter( client, data, [], { channel: command.channel, code: command.channel, }, undefined, true ) : command.channel : channel.id; const ch = channel.guild.channels.cache.get(id); data.channel = command.channel ? (ch ? ch : channel) : channel; await interpreter(client, data, [], command, undefined); } };