可以使用discord.js与discord-rpc,由discord-rpc来驱动*bot的* RPC吗?

huangapple go评论68阅读模式
英文:

Can I use discord.js with discord-rpc, with discord-rpc powering the *bot's* RPC?

问题

我想在我的机器人中使用discord-rpc,为机器人提供带有按钮的丰富存在。
我无法在任何地方找到有关如何做到这一点的信息,开始觉得这可能无法实现,老实说。

如果我无法这样做,那么如何在我的机器人的RPC/Rich Presence中添加按钮,而不进行流式传输?

英文:

I want to use discord-rpc in my bot, to give the bot a rich presense with buttons.
I can't find any information anywhere on how to do it, starting to think it's not doable tbh.

If I cannot do that, How do I add buttons to my bot's RPC/Rich Presence without streaming?

答案1

得分: 0

"Rich presence (using discord-rpc) is designed for apps and games, and not for bots or remote machines. The library works by checking for an open discord instance on the same device as the node.js server and if it is running, send the RPC info. Note that it must be on the same device.

Therefore, if you are running the bot on another machine to your users, this is not possible. If you happen to running the server on the same machine as your client, you can use the library and configure the RPC like normal. You can follow the example on how to do so.

Do also note that discord-rpc is "depreciated in favour of Discord's Game SDK", so expect it not to work in the future.

英文:

Rich presence (using discord-rpc) is designed for apps and games, and not for bots or remote machines. The library works by checking for an open discord instance on the same device as the node.js server and if it is running, send the RPC info. Note that it must be on the same device.

Therefore, if you are running the bot on another machine to your users, this is not possible. If you happen to running the server on the same machine as your client, you can use the library and configure the RPC like normal. You can follow the example on how to do so.

Do also note that discord-rpc is "depreciated in favour of Discord's Game SDK", so expect it not to work in the future.

huangapple
  • 本文由 发表于 2023年6月15日 19:17:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76481921.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定