estoy haciendo un bot de discord (Mi primer bot de discord, para ser mas concretos) y al momento de crear el comando para desbanear a gente, me sale un error.
Código:
const Discord = require('discord.js');
const globals = require("../globals.js");
module.exports = {
name: 'desbanear',
description: 'Desbanea al usuario mencionado del servidor.',
args: true,
usage: '[id-usuario]',
aliases: ['unban'],
guildOnly: true,
async execute(message, args) {
let member = message.member;
const guild = message.guild;
if (member.hasPermission('BAN_MEMBERS')) {
let unbanned = args[0];
let channel = message.channel;
const unBannedEmbed = new Discord.MessageEmbed().setColor('00FF00').setAuthor(`${member.user.username}`).setTitle('Desbaneo').setDescription(`Usuario desbaneado: ${unbanned}`).setTimestamp();
await guild.members.unban(`${unbanned}`);
globals.ConsoleUsedCommand(member.user.username, "desbanear");
await channel.send(unBannedEmbed);
} else {
await message.reply("No tienes permisos para ejecutar este comando.");
globals.ConsoleMessageWithTimestamp(`[ATENCIÓN] Un usuario ha intentado usar un comando y no debería haberlo intentado... Usuario: ${member} Comando: Desbanear.`)
}
},
};
Error:
(node:23412) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body user_id: Value "<@!439413544564555786>" is not snowflake. at RequestHandler.execute (D:\Javigra\Javigra-bot\Javigra-bot\node_modules\discord.js\src\rest\RequestHandler.js:154:13) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async RequestHandler.push (D:\Javigra\Javigra-bot\Javigra-bot\node_modules\discord.js\src\rest\RequestHandler.js:39:14) at async Object.execute (D:\Javigra\Javigra-bot\Javigra-bot\commands\unban.js:18:13) (Use node --trace-warnings ...to show where the warning was created) (node:23412) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:23412) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
No se por que pasa esto, no veo fallos en el código, estoy usando el discord.js 12.5.1. Cualquier aportación es bienvenida :)