首页 > 解决方案 > node.js JavaScript 在自定义状态脚本中给出错误

问题描述

所以我一直在关注这个 YouTube 教程,该教程应该允许您自我机器人并使用按钮显示自定义状态。尝试运行脚本后,当我尝试运行引用第 2 行字符 1 [(提供的屏幕截图)][1] 的脚本时,我不断收到错误代码。现在我已经安装了 node.js,安装后我已经重新启动了我的计算机,但脚本仍然出错。[代码][2] 据我所知,似乎还不错。脚本的整个代码也在帖子正文下方。

const client = new rpc.Client({ transport: 'ipc' })
client.on('ready', () => {
client.request('SET_ACTIVITY', {
pid: process.pid,
activity : {
details : "I DONT EVEN KNOW",
assets : {
large_image : "42615a58-226a-495f-b69f-68517b5a87e2-15b003b6-4790-4de9-926f-46084145177f-v1",
large_text : "All my Stuff is here" // THIS WILL SHOW AS "Playing <Status>" from the outisde
},
buttons : [{label : "Lovense Wishlist" , url : "https://www.lovense.com/wish-list/k68n"},{label : "Checkout My Link Tree",url : "https://linktr.ee/DEVONMAKESVIDS"}]
}
})
})
client.login({ clientId : "842655237516296222" }).catch(console.error);

  [1]: https://i.stack.imgur.com/eVuUw.png
  [2]: https://i.stack.imgur.com/7yYuE.png 

标签: node.js

解决方案


推荐阅读