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

Update dependency discord-player to v6 #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Mar 12, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
discord-player (source) ^3.3.2 -> ^6.0.0 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

Androz2091/discord-player (discord-player)

v6.7.1

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.6.10...discord-player@6.7.1

v6.7.0

Compare Source

What's Changed

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.6.10...discord-player@6.7.0

v6.6.10

Compare Source

What's Changed

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.6.9...discord-player@6.6.10

v6.6.9

Compare Source

New Features

  • New lyrics API and synced lyrics feature is now stable
  • Track now contains cleanTitle property which removes junk from track titles.
New lyrics API
// other methods include .get() .getById() etc.
const results = await player.lyrics.search({ q: track }); // this is a lot better than genius, if you want to search by current track - use track.cleanTitle as the query and specify artistName as well in such situations
// player.lyrics also takes care of ratelimits so you will not get ratelimited
const lyrics= results[0];

if (!lyrics.syncedLyrics) {
  return // no synced lyrics available
}

// load lyrics
const syncedLyrics = queue.syncedLyrics(lyrics);

syncedLyrics.at(timestampInMilliseconds); // manually get a line at specific timestamp. Discord Player resolves closest timestamp

// Synchronize lyrics with the queue
syncedLyrics.onChange(async (lyrics, timestamp) => {
    // timestamp = timestamp in lyrics (not queue's time)
    // lyrics = line in that timestamp
    await interaction.channel?.send({
        content: `[${timestamp}]: ${lyrics}`
    });
});

const unsubscribe = syncedLyrics.subscribe(); // start watching the queue for live updates

unsubscribe(); // call this when you are done, discord-player does this automatically when track ends

What's Changed

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.6.8...discord-player@6.6.9

v6.6.8

Compare Source

New hooks api

Good to know: Previous hooks api is still valid and works as expected.

Previously, hooks required you to pass guild/id as an argument which is expressed as:

const queue = useQueue(interaction.guild.id);

With the new update, there is another method of using hooks, which does not require you to pass guild/id as an argument. In other words, the following code will automatically get the correct queue.

const queue = useQueue();

In order to use this method for hooks, you will need to update your command handler to execute your command with hooks context, which can be written as:

// assuming the following is our command to be executed
const command = getCommandToExecute();

// we would normally execute it as
await command.execute(interaction);

// instead, we have to use the following
const ctx = { guild: interaction.guild };
await player.context.provide(ctx, () => command.execute(interaction));

This would allow every command to use discord-player hooks without having to specify guild/id.

Why is this necessary?

Lets say you have a command and it calls utility function(s) and that utility function also requires access to discord-player data. You'd normally pass it down through arguments over and over again until it reaches the destination. But with this api, you do not need to pass it down via arguments. It will be directly available to the destination.

Changelog

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/[@​discord-player/extractor](https://redirect.github.com/discord-player/extractor)[@​4](https://redirect.github.com/4).4.7...discord-player@6.6.8

v6.6.7

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.6.6...discord-player@6.6.7

v6.6.6

Compare Source

What's Changed

Full Changelog: https://github.com/Androz2091/discord-player/compare/[@​discord-player/extractor](https://redirect.github.com/discord-player/extractor)[@​4](https://redirect.github.com/4).4.5...discord-player@6.6.6

v6.6.5

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/[@​discord-player/equalizer](https://redirect.github.com/discord-player/equalizer)[@​0](https://redirect.github.com/0).2.3...discord-player@6.6.5

v6.6.4

Compare Source

What's Changed

Full Changelog: https://github.com/Androz2091/discord-player/compare/[@​discord-player/extractor](https://redirect.github.com/discord-player/extractor)[@​4](https://redirect.github.com/4).4.3...discord-player@6.6.4

v6.6.3

Compare Source

What's Changed

Full Changelog: https://github.com/Androz2091/discord-player/compare/[@​discord-player/opus](https://redirect.github.com/discord-player/opus)[@​0](https://redirect.github.com/0).1.2...discord-player@6.6.3

v6.6.2

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.6.1...discord-player@6.6.2

v6.6.1

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/[@​discord-player/equalizer](https://redirect.github.com/discord-player/equalizer)[@​0](https://redirect.github.com/0).2.2...discord-player@6.6.1

v6.6.0

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/[@​discord-player/extractor](https://redirect.github.com/discord-player/extractor)[@​4](https://redirect.github.com/4).3.1...discord-player@6.6.0

v6.5.0

Compare Source

Changelog

  • fix(QueryResolver): spotify playlists were treated as youtube playlists
  • feat(GuildQueueEvents): add willPlayTrack event
  • types(GuildQueueEvent): make events constant usable in event listener
  • feat(GuildQueue): expose maxSize and maxHistorySize
  • feat(GuildQueue): add options.preferBridgedMetadata
  • fix(Track): resolve null upon metadata query failure
  • feat(GuildQueuePlayerNode): add .totalDuration getter
  • feat(GuildQueuePlayerNode): implement StreamConfig
Example of willPlayTrack event
// listening to this event pauses discord-player's execution process until `done()` is invoked
player.events.on(GuildQueueEvent.willPlayTrack, (queue, track, config, done) => {
    // set volume to 30%
    config.dispatcherConfig.volume = 30;

    // seek to 20 seconds before playing
    config.playerConfig.seek = 20;
    
    // tell discord-player to resume execution process
    return done();
});

Full Changelog: https://github.com/Androz2091/discord-player/compare/[@​discord-player/extractor](https://redirect.github.com/discord-player/extractor)[@​4](https://redirect.github.com/4).3.0...discord-player@6.5.0

v6.4.0

Compare Source

What's Changed

  • feat: track metadata api
  • fix: spotify regex
  • feat: bridge query resolver
  • feat: track metadata api
  • feat: introduce play method on tracks and queues
  • feat: allow audio player options on play method
  • feat: error codes
  • Update my community bot version and description by @​L0SER8228 in https://github.com/Androz2091/discord-player/pull/1742

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.3.1...discord-player@6.4.0

v6.3.1

Compare Source

What's Changed

Full Changelog: https://github.com/Androz2091/discord-player/compare/[@​discord-player/extractor](https://redirect.github.com/discord-player/extractor)[@​4](https://redirect.github.com/4).2.2...discord-player@6.3.1

v6.3.0

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.2.1...discord-player@6.3.0

v6.2.1

Compare Source

Changelog

  • fix esm build

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.2.0...discord-player@6.2.1

v6.2.0

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.1.1...discord-player@6.2.0

v6.1.1

Compare Source

What's Changed

Full Changelog: https://github.com/Androz2091/discord-player/compare/discord-player@6.1.0...discord-player@6.1.1

v6.1.0

Compare Source

Changelog

New Contributors

Full Changelog: https://github.com/Androz2091/discord-player/compare/v6.0.0...discord-player@6.1.0

v6.0.0: 6.0.0

Compare Source

BREAKING CHANGES!!

⚠️ [semver:major] This release contains breaking changes, making old codes unusable.

Documentation: https://discord-player.js.org
Migration Guide: https://discord-player.js.org/docs/guides/v6-migration

What's Changed

New Contributors

Full Changelog: Androz2091/discord-player@v5.4.0...v6.0.0

v5.4.0: 5.4.0

Compare Source

What's Changed

New Equalizer API

Equalizer can be accessed with queue.connection.equalizer which may be EqualizerStream instance or null. Just like inline volume, equalizer can be disabled by passing disableEqualizer: true to createQueue.

if (!queue.isEqualizerEnabled()) return message.reply("Equalizer is not available");

const bands = [
    { band: 0, gain: 0.25 },
    { band: 1, gain: 0.25 },
    { band: 2, gain: 0.25 },
];

// apply config
queue.setEqualizer(bands);

// toggle equalizer on/off
queue.toggleEqualizer();
queue.enableEqualizer();
queue.disableEqualizer();

// get equalizer state
queue.getEqualizer();

// Pass nothing or pass an empty array to reset equalizer
queue.setEqualizer();
queue.setEqualizer([]);

// set specific band
queue.setEqualizerBand(band, gain);

// get specific band
queue.getEqualizerBand(band);

Note: Equalizer runs before volume transformer and after ffmpeg and thus it may change ffmpeg filters behavior.

New Contributors

Full Changelog: Androz2091/discord-player@v5.3.2...v5.4.0

v5.3.2: 5.3.2

Compare Source

What's Changed

  • fix(Queue): shuffle all tracks
  • fix(AudioFilters): properly get filters
  • feat(Queue): add leaveOnEndCooldown
  • fix(Player): rewrite spotify metadata parser
  • fix(StreamDispatcher): skip the track if it has already ended
  • fix(Queue): volume state should persist
  • feat: show warning message on incompatible discord.js versions
  • fix(AudioFilters): remove filters getter
  • feat(Player): add generateStatistics method
  • feat(Player): add eventLoopLag getter
  • feat(Queue): add generateStatistics method
  • feat(Queue): add ping getter
  • feat(Queue): add forceNext method
  • chore(deps): move ytdl-core, soundcloud-scraper, youtube-sr, spotify-url-info to peerDependencies

Full Changelog: Androz2091/discord-player@v5.3.1...v5.3.2

v5.3.1: 5.3.1

Compare Source

What's Changed

Full Changelog: Androz2091/discord-player@v5.3.0...v5.3.1

v5.3.0: 5.3.0

Compare Source

What's Changed

Full Changelog: Androz2091/discord-player@v5.2.2...v5.3.0

v5.2.2: 5.2.2

Compare Source

Updates

  • 💉Try auto smoothVolume injection on startup
  • 🦥Lazily create voice connection
  • 🔨Check voice intents properly

Full Changelog: Androz2091/discord-player@v5.2.1...v5.2.2

v5.2.1: 5.2.1

Compare Source

What's Changed

Full Changelog: Androz2091/discord-player@v5.2.0...v5.2.1

v5.2.0: 5.2.0

Compare Source

Features

  • feat(Queue): add onBeforeCreateStream to Queue instance and queue init options
    • See below for example.
  • feat(Queue): add skipTo method (https://github.com/Androz2091/discord-player/pull/806/commits/751ce122bc29a8c19d0256b52759b73d77997229)
    • Skips to the given position in the queue.
  • feat(Queue): add spotifyBridge option (edb517c)
    • This option is by default enabled and it basically resolves spotify tracks from youtube automatically. You can disable this by using spotifyBridge: false on createQueue options
  • feat(Queue): add disableVolume option (87d49c6)
    • Player volume controls are available on-the-fly by default. If you don't need this, you can disable volume controls by simply passing disableVolume: true on createQueue options
  • feat(Queue): handle error events by default (3185557)
    • This will by default emit a warning and log the error if there are no error listeners registered.

Fixes

Queue.onBeforeCreateStream

This method traps the stream downloader. This is not related to extractors api though, since it can bypass those. This could also be used to block certain source like youtube. You can disable spotifyBridge to block spotify<->youtube bridge.

Note: this method may not work properly if spotifyBridge is enabled.

Discord Player won't switch to anything else from ytdl-core at the moment.

const playdl = require("play-dl");

// other code
const queue = player.createQueue(..., {
    ...,,
    spotifyBridge: false, // set this to tru

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/husnuljahneer/discord-bot).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNTkuMSIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi43IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->

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.

0 participants