【发布时间】:2018-11-19 20:05:12
【问题描述】:
我正在开发一个不和谐的机器人,但是当我尝试使用任何命令时,我得到了这个错误。
操作系统:Windows 10
语言:Java 版本 8 更新 171
代码:https://pastebin.com/jDLspKF6
错误: C:\Users\Acer\Desktop\c\node_modules\discord.js\src\util\Collection.js:195 if (typeof value === 'undefined') throw new Error('必须指定值。'); ^
Error: Value must be specified.
at Map.find (C:\Users\Acer\Desktop\c\node_modules\discord.js\src\util\Collection.js:195:47)
at Client.bot.elevation.message [as elevation] (C:\Users\Acer\Desktop\c\app.js:53:40)
at Client.module.exports.message (C:\Users\Acer\Desktop\c\events\message.js:8:24)
at Client.emit (events.js:182:13)
at MessageCreateHandler.handle (C:\Users\Acer\Desktop\c\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\Acer\Desktop\c\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\Acer\Desktop\c\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\Acer\Desktop\c\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\Acer\Desktop\c\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:182:13)
有人可以帮帮我吗?
【问题讨论】:
-
您应该发布您的代码,而不仅仅是发布错误消息。 Without a Minimal, Complete, Verifiable Example, it is hard to know what is wrong
-
这里是代码pastebin.com/jDLspKF6,我尝试用客户端替换bot,但仍然没有成功
-
pastebin 上的代码 sn-p 中的哪一行导致了错误?这不完全是 MCVE,所以你至少应该让我们知道错误发生在哪里。
-
语言是 Javascript,不是 Java :)
标签: javascript node.js discord.js