英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论