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

fix(ClientPresence): produce valid activities for set presences #5799

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

SpaceEEC
Copy link
Member

@SpaceEEC SpaceEEC commented Jun 10, 2021

Please describe the changes this PR makes and why it should be merged:

This PR resolves #5706 and resolves #5584.

The Gateway Presence Update Structure's activities array is documented to not be nullable.
So this PR defaults it to an empty array then.

Also as noted for the Activity Structure, bots may only send name, type and optionally url.
So this PR maps previously set activities to only have those properties left (defaulting url to undefined since sending null invalidates your session too, albeit being documented as nullable).

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@iCrawl iCrawl merged commit ea0e06f into discordjs:master Jun 10, 2021
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

client.user.setStatus(); kills the bot (INVALID SESSION) Clearing client activities invalidates session
4 participants