我正在尝试编写一个机器人程序,以使当用户加入服务器时它会为他添加角色“ Banda canina”,我试图给他一个管理员角色,但它继续出现此错误。这是代码
UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at RequestHandler.execute (C:\Users\Pc\Desktop\Bot Gio\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:8268) 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: 2)
我在另一台测试服务器上尝试了该bot,它可以工作,但在主服务器上却没有。这是完整的错误:
test1