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

feat(core): implement some ws send events #8941

Merged
merged 9 commits into from
Jan 5, 2023

Conversation

suneettipirneni
Copy link
Member

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

This implements guild member requests, voice state updating and presence updating for /core.

This PR is breaking as it converts createClient to a class.

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
  • This PR changes the library's interface (methods or parameters added)
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

@vercel
Copy link

vercel bot commented Dec 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
discord-js ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 5, 2023 at 10:00PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
discord-js-guide ⬜️ Ignored (Inspect) Jan 5, 2023 at 10:00PM (UTC)

packages/core/src/client.ts Outdated Show resolved Hide resolved
Copy link
Member

@almeidx almeidx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The readme example needs to be updated to use the new Client class

@suneettipirneni suneettipirneni requested review from kyranet and removed request for vladfrangu, iCrawl and SpaceEEC December 19, 2022 13:15
packages/core/README.md Outdated Show resolved Hide resolved
packages/core/src/client.ts Outdated Show resolved Hide resolved
packages/core/README.md Outdated Show resolved Hide resolved
Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I was thinking that maybe we should probably support a version of requestGuildMembers which returns an async iterable, so we can do operations on members while they come thru. Obviously, requestGuildMembers would consume this async iterator and flatten the chunks.

packages/core/src/client.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 25, 2022

Codecov Report

Merging #8941 (aef156f) into main (18b3a19) will increase coverage by 0.12%.
The diff coverage is 98.03%.

❗ Current head aef156f differs from pull request most recent head ed44015. Consider uploading reports for the commit ed44015 to get more accurate results

@@            Coverage Diff             @@
##             main    #8941      +/-   ##
==========================================
+ Coverage   84.35%   84.48%   +0.12%     
==========================================
  Files          98       99       +1     
  Lines        9180     9268      +88     
  Branches     1096     1100       +4     
==========================================
+ Hits         7744     7830      +86     
- Misses       1394     1396       +2     
  Partials       42       42              
Flag Coverage Δ
brokers 65.24% <ø> (ø)
builders 98.25% <100.00%> (+0.02%) ⬆️
collection 100.00% <ø> (ø)
proxy 77.37% <ø> (ø)
rest 91.97% <ø> (ø)
util 98.42% <96.15%> (-1.58%) ⬇️
utilities 100.00% <ø> (ø)
voice 63.77% <ø> (ø)
ws 58.78% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/util/src/functions/calculateShardId.ts 33.33% <33.33%> (ø)
...ders/src/components/selectMenu/StringSelectMenu.ts 100.00% <100.00%> (ø)
packages/util/src/functions/range.ts 100.00% <100.00%> (ø)
packages/ws/src/ws/WebSocketManager.ts 95.70% <100.00%> (+0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

packages/core/src/util/ws.ts Outdated Show resolved Hide resolved
@vladfrangu
Copy link
Member

By the way, I was thinking that maybe we should probably support a version of requestGuildMembers which returns an async iterable, so we can do operations on members while they come thru. Obviously, requestGuildMembers would consume this async iterator and flatten the chunks.

I'd open an issue for this so we dont forget @kyranet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants