node.js - 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
解决方案
推荐阅读
- reactjs - Why am Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: number
- c++ - C++ 强制转换模板类型
- javascript - 根据对象内的值将对象数组一分为二
- php - Symfony 5异常找不到驱动程序
- c++ - 用 C++ 理解这个回文代码
- iframe - 在网站上清除 iframe 中的值
- next.js - 在下一个 js 中从父级传递到组件时,道具未定义
- node.js - Firebase-admin nodejs SDK 无法连接
- c# - 使用 C# HttpClient 时收到 HTTP 500 响应
- excel - 如何在excel中为矩阵形式计算不同的值