Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

refactor(Adapter): sendPayload now returns boolean#105

Merged
amishshah merged 5 commits into
mainfrom
feat/adapter-refactor
Jun 6, 2021
Merged

refactor(Adapter): sendPayload now returns boolean#105
amishshah merged 5 commits into
mainfrom
feat/adapter-refactor

Conversation

@amishshah
Copy link
Copy Markdown
Member

@amishshah amishshah commented Jun 5, 2021

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

Makes adapters easier to work with. At the moment, the only way to signal that a message cannot be sent via sendPayload is to destroy the whole adapter. This PR allows for sendPayload to return false if the message can definitely not be sent, and in this case, the voice connection enters the disconnected state rather than being destroyed entirely.

This means the developer has to call voiceConnection.reconnect() once the adapter later becomes available.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • This PR changes the library's interface (methods or parameters added)
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2021

Codecov Report

Merging #105 (316d825) into main (62cc43b) will decrease coverage by 0.26%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
- Coverage   63.69%   63.42%   -0.27%     
==========================================
  Files          18       18              
  Lines         807      812       +5     
  Branches      181      191      +10     
==========================================
+ Hits          514      515       +1     
- Misses        291      295       +4     
  Partials        2        2              
Impacted Files Coverage Δ
src/VoiceConnection.ts 80.00% <100.00%> (+0.86%) ⬆️
src/audio/AudioResource.ts 95.34% <100.00%> (ø)
src/util/Secretbox.ts 35.29% <0.00%> (-23.53%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62cc43b...316d825. Read the comment docs.

@amishshah amishshah requested a review from kyranet June 5, 2021 15:40
@amishshah amishshah marked this pull request as ready for review June 5, 2021 15:41
@amishshah amishshah merged commit dd51d0b into main Jun 6, 2021
@amishshah amishshah deleted the feat/adapter-refactor branch June 6, 2021 09:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant