MCMi460 / NSO-RPC

Connect your Nintendo Switch playing status to Discord!
321 stars 32 forks source link

2 little changes #9

Open katschuba opened 2 years ago

katschuba commented 2 years ago

Hi, first of all: Very nice tool!

2 ideas for improvement: 1st: Could you make it that the name of the game comes up first, and then the console I'm playing it on? So others can see at a glance on the memberlist which game I'm playing.

2nd: MacOS. Coloring the icon black, when the menubar is in daylight mode, so that it fits to all the other icons 😁

pelicanfuture commented 2 years ago

Yeah, I also support your 1st idea as well, it would make the status be similar to the built-in Xbox Live and PSN statuses where the game shows up first, then the console you're playing on when you click on the discord profile.

MCMi460 commented 2 years ago

As far as I know, the first is impossible with Discord's current method of rich presence applications. The name of the "Playing" status is taken from the application's name, and it would be a bit too much for me to create over 5,000 separate developer applications for each Nintendo Switch game. As for the second one, I'll certainly work on that. I believe there is a native MacOS method for dynamic status bar icons, but I'm not certain that PyQt5 supports it. Worst case scenario, I'll just make a separate icon and load it depending on the system theme. I'll keep this issue open until I finish the second change.

MCMi460 commented 2 years ago

Should work properly now.

Please comment on this issue if any problems arise. Thank you!

katschuba commented 2 years ago

Thanks man, very nice! When can we expect the new release-version to download?

MCMi460 commented 2 years ago

I still have a few things to touch-up on, but probably on Friday. If you want, you can always build to an app using the scripts/build.sh script on the development branch.

samuelthomas2774 commented 2 years ago

1st: Could you make it that the name of the game comes up first, [...]? So others can see at a glance on the memberlist which game I'm playing.

As far as I know, the first is impossible with Discord's current method of rich presence applications. The name of the "Playing" status is taken from the application's name, and it would be a bit too much for me to create over 5,000 separate developer applications for each Nintendo Switch game.

I've created Discord applications for most Nintendo-published games: https://github.com/samuelthomas2774/nxapi/tree/main/src/discord/titles. @MCMi460 I don't mind you using these as well; pypresence seems to support disconnecting/reconnecting to Discord with another client ID. Anyone can create an issue on my repo to suggest any other titles (only for more popular games though, like @MCMi460 I'm not creating 100s/1000s of Discord applications).

Discord actually fetches the application name and sets it as the activity name locally, so with a modified/custom client (e.g. discord.js) we could just pass the name to Discord. There's also an API for this but it's restricted to Xbox Live, PlayStation and a few others.

MCMi460 commented 2 years ago

I've created Discord applications for most Nintendo-published games: https://github.com/samuelthomas2774/nxapi/tree/main/src/discord/titles. @MCMi460 I don't mind you using these as well [...]

Ah, thank you @samuelthomas2774! I'll add this soon.

Discord actually fetches the application name and sets it as the activity name locally, so with a modified/custom client (e.g. discord.js) we could just pass the name to Discord. There's also an API for this but it's restricted to Xbox Live, PlayStation and a few others.

I'd prefer not to attempt to bypass Discord's decisions. If I really wanted to do something like this, I'd instead just bundle a bare-bones self-bot script inside NSO-RPC, log into the user's account, and make the activities.write API calls manually. That's very interesting, though, thanks for telling me!

samuelthomas2774 commented 2 years ago

I've created Discord applications for most Nintendo-published games: https://github.com/samuelthomas2774/nxapi/tree/main/src/discord/titles. @MCMi460 I don't mind you using these as well [...]

Ah, thank you @samuelthomas2774! I'll add this soon.

I have a script to export these as JSON/CSV, so they can be fetched at runtime, as they are written in TypeScript to allow for custom behaviour (just remember to cache the data for a few days if you do this 😄). I might change the format slightly so don't use these links yet.

URL -
https://nxapi.ta.fancy.org.uk/data/discord-titles.json JSON
https://nxapi.ta.fancy.org.uk/data/discord-titles-compact.json JSON without Discord activity configuration
https://nxapi.ta.fancy.org.uk/data/discord-clients.json JSON with Discord app data
https://nxapi.ta.fancy.org.uk/data/discord-titles.csv CSV
https://nxapi.ta.fancy.org.uk/data/discord-titles-compact.csv CSV without Discord activity configuration

I'd prefer not to attempt to bypass Discord's decisions. If I really wanted to do something like this, I'd instead just bundle a bare-bones self-bot script inside NSO-RPC, log into the user's account, and make the activities.write API calls manually. That's very interesting, though, thanks for telling me!

Same. I tried using the activities.write OAuth scope but it just rejects it (after allowing me to authorise it) - hopefully Discord will open this API soon, it would also mean this would work without having Discord open, and also for other non-desktop platforms (e.g. mobile games).

katschuba commented 2 years ago

@MCMi460 Installed the new version. Works fine so far. 👍 But could you change the behaviour of the titlebar-buttons? Currently the menubar icon is only visible when hitting the close button of the settings window. I would prefer red-button (close) for quitting the app and yellow-button (minimize) for minimizing to the menubar. And in addition it would be cool if when minimized, the app is hidden from dock and only visible in the menubar.

jrub1 commented 2 years ago

+1ing the idea of the app being hidden on the dock! Great app so far, thank you!

MCMi460 commented 1 year ago

In the same vein as #63, I am considering adding the game's name status support for games over Discord presence, though it may be some time before that comes to being.