One of my friends (@theLMGN) made something similar to this a while back, but it isn’t as complex as this.
Nice work on this project
The presence is now working again, just refreshed the cookie.
Just messed around with this; used a package I created a while ago called bloxauth-win
to request presence data, and it works pretty well:
Test code
const bloxauth = require('bloxauth-win'),
discord = require('discord-rpc'),
rpc = new discord.Client({ transport: 'ipc' });
rpc.on('ready', async () => {
bloxauth.getCurrentUser().then(currentUser => {
const getPresence = () => {
bloxauth.request({
uri: `https://www.roblox.com/presence/user?userId=${currentUser.UserID}`
}).then(presence => {
let rpcInfo = {}, setInfo = true;
switch (presence.UserPresenceType) {
case 2:
rpcInfo.details = 'Playing a game';
rpcInfo.state = `${presence.LastLocation}`;
break;
case 3:
rpcInfo.details = 'Developing in Studio';
rpcInfo.state = `${presence.LastLocation}`;
break;
default:
setInfo = false;
break;
}
if (!setInfo) {
rpc.clearActivity();
} else {
rpcInfo.instance = false;
rpc.setActivity(rpcInfo);
}
});
}
getPresence();
setInterval(getPresence, 15e3);
});
});
rpc.login({ clientId: '595172822410592266' });
Yes, I used your clientId; sorry!
…and since I’m logging in with my own cookie (from Studio), it can request my location, regardless of privacy settings.
Obviously, this is Windows-specific again
Interesting, is your package available on NPM/GitHub?
Nevermind, didn’t see the link.
I’m looking at this now.
I’ve had a go at my own implementation using my bloxauth-win
package.
Details
Download+Source Code:
https://github.com/ClockworkSquirrel/roblox-discord-presence
In-Game
Information Displayed
Roblox
Username
Game Name (Server Capacity)
Time Played
In Studio
Privacy Settings
Just a note for anyone who wants to try it; it is Windows only!
Why is it windows only?
Not a problem for me, but for other users,
my version is Windows only simply because it gets your login cookie from the Windows registry
Edit: @JiveOff’s proper version should be compatible with all OS, as it’s using external servers, and requires you to connect your Roblox to Discord via roVerify.
Your solution is very nice.
I will mention it on the git README when I have time.
Thanks for the contribution!
Will take a look into this!
Good job.
Really good work!
This was super easy to install and worked almost immediately. I also really like the little end connection page, it feels really clean.
This is awesome sauce.
Thank you for this!
Hey Jive,
I’ve got a really small change for RoPresence;
Is it worth sending a pull request yet?
The change is important but small.
Thanks,
Sasial.
Feel free to make a PR.
I like this, it reminds me of the days where we had cmd prompt open before spotify presence was built it. Hope that roblox does something like this
Any chance of this being available to download for MacOS systems using terminal instead of the normal CMD prompt on windows?
Wow, sounds great. Going to check it out.
There is a macOS part on the README.md, which part are you struggling with?
Nice job! Can you also make it so if we’re in studio it shows the studio logo instead of the normal one? Thanks!
Ah cheers, didn’t see that. Must of missed it…