【发布时间】:2018-11-29 05:51:13
【问题描述】:
我正在尝试删除用户的所有角色。这段代码昨天有效,但我今天上了,它不知何故坏了。
message.member.removeRoles(message.member.roles.filter(role => role.name!='Admin' && role.name!='@everyone'));
堆栈跟踪:
(node:27392) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Guild
at item.request.gen.end (C:\Users\nnova\Documents\Discord\Bots\repbot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:71:65)
at then (C:\Users\nnova\Documents\Discord\Bots\repbot\node_modules\snekfetch\src\index.js:215:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:27392) 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: 2)
(node:27392) [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.
堆栈跟踪中没有任何地方引用我的代码...
有人知道发生了什么吗?我花了一个小时搜索并尝试调试它。
【问题讨论】:
标签: javascript node.js discord.js