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(engines): remove unnecessary array for search method #17

Merged
merged 1 commit into from
May 13, 2023

Conversation

larsrickert
Copy link
Owner

@larsrickert larsrickert commented May 13, 2023

BREAKING CHANGE: Changed type PlayerEngine and all pre-built engines (youtube, spotify and file) to return SearchResult|null instead of SearchResult[]. The previous return value just wrapped the search result into an array so its length was always 1. Thats why it has been changed.
BREAKING CHANGE: player.search() now returns SearchResult|null instead of SearchResult[]

BREAKING CHANGE: player.search() returns a single search result or null instead of an array.
BREAKING CHANGE: Changed type PlayerEngine and all pre-built engines (youtube, spotify and file) to return a single search result or null when calling search()
@larsrickert larsrickert merged commit 503ab0b into v2 May 13, 2023
@larsrickert larsrickert deleted the fix/update-engine-search-return-type branch May 13, 2023 12:56
github-actions bot pushed a commit that referenced this pull request May 14, 2023
# [2.0.0-rc.1](v1.5.2...v2.0.0-rc.1) (2023-05-14)

### Bug Fixes

* **engines:** remove unnecessary array for `search` method ([#17](#17)) ([503ab0b](503ab0b))

### chore

* migrate to pnpm ([#14](#14)) ([a5f7ec7](a5f7ec7))

### Features

* support both ESM and CommonJS ([#15](#15)) ([01218cf](01218cf))
* update example discord bot ([#19](#19)) ([480a0ea](480a0ea))

### BREAKING CHANGES

* **engines:** Changed type `PlayerEngine` and all pre-built engines
(youtube, spotify and file) to return `SearchResult|null` instead of
`SearchResult[]`. The previous return value just wrapped the search
result into an array so its length was always 1. Thats why it has been
changed.
* **engines:** `player.search()` now returns `SearchResult|null`
instead of `SearchResult[]`
* bump min required version of `@discordjs/opus` from
`0.5.1` to `0.8.0`
* bump min required version of `discord.js` from `14.5.0`
to `14.8.0`
* add peerDependency `discord-api-types` with min version
`0.37.0`
@github-actions
Copy link

🎉 This PR is included in version 2.0.0-rc.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Jun 13, 2023
# [2.0.0](v1.5.2...v2.0.0) (2023-06-13)

### Bug Fixes

* downgrade music-metadata to support commonjs ([#23](#23)) ([039a29e](039a29e))
* **engines:** remove unnecessary array for `search` method ([#17](#17)) ([503ab0b](503ab0b))

### chore

* migrate to pnpm ([#14](#14)) ([a5f7ec7](a5f7ec7))

### Features

* support both ESM and CommonJS ([#15](#15)) ([01218cf](01218cf))
* update example discord bot ([#19](#19)) ([480a0ea](480a0ea))

### BREAKING CHANGES

* **engines:** Changed type `PlayerEngine` and all pre-built engines
(youtube, spotify and file) to return `SearchResult|null` instead of
`SearchResult[]`. The previous return value just wrapped the search
result into an array so its length was always 1. Thats why it has been
changed.
* **engines:** `player.search()` now returns `SearchResult|null`
instead of `SearchResult[]`
* bump min required version of `@discordjs/opus` from
`0.5.1` to `0.8.0`
* bump min required version of `discord.js` from `14.5.0`
to `14.8.0`
* add peerDependency `discord-api-types` with min version
`0.37.0`
@github-actions
Copy link

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

1 participant