День добрый!
Возникли проблемы т.к бот не хочет кикать даже самого обычного участника.
Код события:
spoiler
if (message.content.startsWith("!kick")) { if(!message.member.roles.some(r=>["Administrator", "Moderator"].includes(r.name))) { return message.reply("Извините, но у вас нет прав!");
} let mem = message.content.split(' ');
let member = mem[1]; var reason = mem[2];
if(!reason) reason = "Без причины";
member.kick(reason);
message.reply(member.user.tag + " бы
л кикнут " + message.author.tag + "!Причины
" + reason);
}
Лог:
spoiler
(node:13936) UnhandledPromiseRejectionWarning: TypeError: member.kick is not a function at Client. (/data/data/com.termux/files/home/musicbot/index.js:43:9)
at Client.emit (events.js:210:5) at MessageCreateHandler.handle (/data/data/com.termux/files/home/musicbot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34) at WebSocketPacketManager.handle (/data/data/com.termux/files/home/musicbot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65) at WebSocketConnection.onPacket (/data/data/com.termux/files/home/musicbot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/data/data/com.termux/files/home/musicbot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/data/data/com.termux/files/home/musicbot/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:210:5)
at Receiver.receiverOnMessage (/data/data/com.termux/files/home/musicbot/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:210:5)
(node:13936) 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(). (rejection id: 1)
(node:13936) [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.
Только можно без доп.библеотек, чисто на discord.js.