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

Remove /users/@me call for socket and rework sharded client a bit #1860

Merged
merged 2 commits into from
May 28, 2021

Conversation

SubZero0
Copy link
Member

@SubZero0 SubZero0 commented May 28, 2021

Summary

The current user is sent on READY and there's no need to do a rest request for it (much less N of them if using a sharded client), so this call was removed from the socket client.
In a few times some shards that werent the first one would be ready faster and DiscordShardedClient.CurrentUser could be null, now this property will get the first not null CurrentUser from any shard.

Changes

  • Removed /users/@me rest request for socket client
  • DiscordShardedClient.Rest might return null instead of throwing an exception if it wasnt initialized yet
  • DiscordShardedClient.CurrentUser will get the first not null CurrentUser from any shard instead of just the "primary"

@SubZero0 SubZero0 merged commit 384ad85 into discord-net:dev May 28, 2021
@SubZero0 SubZero0 deleted the remove-getcurrentuser-socket branch May 28, 2021 21:40
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.

None yet

1 participant