Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change activity of a non-bot client #2541

Closed
1 of 2 tasks
TotomInc opened this issue May 6, 2018 · 5 comments
Closed
1 of 2 tasks

Can't change activity of a non-bot client #2541

TotomInc opened this issue May 6, 2018 · 5 comments

Comments

@TotomInc
Copy link

TotomInc commented May 6, 2018

Please describe the problem you are having in as much detail as possible:

I am trying to make a small userscript that display the current track playing from SoundCloud on Google Chrome, linked to my Discord user account. It works well with a bot-client but the user activity don't change when I'm logged in with a user account.

When testing the script, I am logged from both the Windows Discord client and the SoundCloud tab. Maybe it's because of 2 simultaneous connections on a same (user?) account.

As a side note, I can change the status (from idle to online, DND to idle, ...).

Include a reproducible code sample here, if possible:

// retrieve the track title from the soundcloud tab
let track = 'track title from soundcloud tab';

// once track title retrieved, set the new user activity with the track name
client.user.setActivity(track)
	.then((activity) => console.log('[DiscordJS EXTENSION] activity set:', activity));

Further details:

  • discord.js version: 11.3-dev for browser

  • node.js version: browser (Google Chrome 66.0.3359.139)

  • Operating system: Windows 10

  • Priority this issue should have: very low

  • I found this issue while running code on a user account

  • I have also tested the issue on latest master, commit hash:

@devsnek
Copy link
Member

devsnek commented May 6, 2018

you should use RPC for this: https://github.com/discordjs/RPC

@TotomInc
Copy link
Author

TotomInc commented May 6, 2018

Alright, thanks!

@TotomInc TotomInc closed this as completed May 6, 2018
@TotomInc
Copy link
Author

TotomInc commented May 7, 2018

Discord RPC is currently in private beta according to Discord dev-docs, I get Invalid Origin error.

@TotomInc TotomInc reopened this May 7, 2018
@devsnek
Copy link
Member

devsnek commented May 7, 2018

@Totomlnc you should use IPC not websockets

@TotomInc
Copy link
Author

TotomInc commented May 8, 2018

@TotomInc TotomInc closed this as completed May 8, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants