[英]'Error: unable to verify the first certificate' when trying to start discord bot
I've encountered an error when setting up a discord bot using Visual Studio Code & Node. 使用Visual Studio Code&Node设置Discord bot时遇到错误。
This is the code that makes the bot go online: 这是使机器人联机的代码:
const Discord = require('discord.js');
const bot = new Discord.Client();
bot.login('[the token i recieved for my bot]');
The error I get from running this is: 我从运行此得到的错误是:
(node:7064) UnhandledPromiseRejectionWarning: Error: unable to verify the first certificate warning.js:18
at TLSSocket.onConnectSecure (_tls_wrap.js:1049:34)
at TLSSocket.emit (events.js:182:13)
at TLSSocket._finishInit (_tls_wrap.js:631:8)
(node:7064) 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) warning.js:18
(node:7064) [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. warning.js:18
Can anyone help me debug this or not get this error? 谁能帮助我调试此错误或无法得到此错误?
I was not able to reproduce your error, using the exact same setup. 使用完全相同的设置,我无法重现您的错误。
discord.js: v11.4.2
andVisual Studio Code: v1.28.2
discord.js: v11.4.2
和Visual Studio Code: v1.28.2
If you still experience this issue, maybe this can help you . 如果您仍然遇到此问题, 也许可以为您提供帮助 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.