Giter Club home page Giter Club logo

magmastream's People

Contributors

birongliu avatar dependabot[bot] avatar itzrandom23 avatar jirayusrisawat-github avatar memte avatar mrdieselgr avatar nansess avatar nickdevnl avatar spiderjockey02 avatar sxmabel avatar vexify4103 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

magmastream's Issues

Spotify songs

Your Question
How to play Spotify?

Additional Context
client.manager = new Manager({ nodes: nodes, defaultSearchPlatform: 'spsearch', send: (id, payload) => { const guild = client.guilds.cache.get(id); if (guild) guild.shard.send(payload); } });

Clearfilters not working

NodeJs Version: 20.4.0
Lavalink Version: 4.0.0-beta.2
Magmastream NPM Package Version: 2.2.1

Describe the Bug
Whenever I start a filter for ex: Bassboost, it works perfectly but when I do .clearFilters(), nothing happens. I have checked for errors etc and I had no errors.

To Reproduce
Steps to reproduce the behavior:

  1. Play the music
  2. Turn on the filter
  3. Wait for it to turn on
  4. Using clearFilters will never turn it off now

Expected Behavior
It should clear all filters using clearFilters but it is not working and expected.

Screenshots
N/A

Additional Context
N/A

Enhanced "playerStateUpdate" Event with oldState and newState

Enhanced "playerStateUpdate" Event Details:

With this proposed enhancement, the "playerStateUpdate" event should include the following information:

oldState: A descriptive object representing the state of the player before the change occurred.
newState: A descriptive object representing the state of the player after the change occurred.

Example Usage:
`// Example "playerStateUpdate" event usage
.on('playerStateUpdate', (oldState, newState) => {
// Check for changes related to pausing/resuming
if (oldState.paused !== newState.paused) {
if (newState.paused) {
console.log('Player was paused.');
} else {
console.log('Player was resumed.');
}
}

const loopModeChanged = oldState.queueRepeat !== newState.queueRepeat ||
oldState.trackRepeat !== newState.trackRepeat;

if (loopModeChanged) {
if (newState.queueRepeat && !newState.trackRepeat) {
// loopqueue: true and false
console.log('Loop mode changed from "track" to "queue".');
} else if (newState.trackRepeat && !newState.queueRepeat) {
// loopsong: false and true
console.log('Loop mode changed from "queue" to "track".');
}
// If both queueRepeat and trackRepeat are false, loop mode is "off"
// You can add additional logic for "off" loop mode if needed.
}
});`

Benefits:

Implementing this enhancement would provide several advantages to the erela.js community:

  1. Simplified Event Handling: Developers can access the relevant state changes directly through oldState and newState without the need to deal with the player instance.
  2. Reduced Resource Consumption: By excluding the player instance, the event payload becomes more lightweight and resource-friendly.
  3. Improved Flexibility: The enhanced event allows developers to implement state change monitoring and custom handling with increased ease and clarity.

Conclusion:

I believe that enhancing the "playerStateUpdate" event to return only the oldState and newState objects would be a valuable improvement to erela.js. It will empower developers to create more efficient, responsive, and resource-conscious music bots.

Thank you for considering my feature request. Your dedication to refining erela.js and providing the community with an exceptional library is truly commendable. I'm excited to witness the continued growth and evolution of this project.

Music filters

How do I apply filters to my music?

{ Manager: [Getter], Node: [Getter], Player: [Getter], Queue: [Getter], TrackUtils: [Getter], Structure: [Getter], Plugin: [Getter] }

Load Balancing Properly

Problem:
The current load-balancing system relies on CPU usage, neglecting server distribution across nodes and my other nodes in diff regions aren't used

Solution:
Implement load balancing based on server regions. Allow labeling of nodes with regions for management.

Add a custom store with the tracks

Is your feature request related to a problem? Please describe.
I've created a music bot with your library but i encounter a little problem...
I can't store if a music is a radio from us or if it one from the user
I've managed to get around this by storing in Track.requester an object with what i've needed (radio from us or not and who asked for the music)
But with the last update, you've added type to Track.requester (great !)

Describe the Solution You'd Like
Could you add a custom field in the Track interface to store additional data (whatever we want so with unknown

Describe Alternatives You've Considered
For now i force things by overriding this field and "it works enough"

Additional Context
Nothing to add i think

New event: playerStateUpdate

Event Details:

The "playerStateUpdate" event would be triggered whenever there is a significant state change in the player. Specifically, it should respond with the following information:

  1. Player: The instance of the player that experienced the state change.
  2. State Update: A descriptive object containing details about the specific change that occurred. This could include information about pausing, resuming, and loop-mode changes.

Supported State Changes:

The event should cover the following player state updates:

  • Pause/Resume: When the player gets paused or resumed during music playback.
  • Loop Mode: When the loop-mode of the player changes from "track" to "queue" or "off" (and vice versa).

Use Case:

The primary purpose of this event is to help developers handle potential timeout issues in their Discord bots. At times, due to external factors, the bot's timeout duration may be shorter than the duration of the track playing through the player. This can result in the player getting destroyed while it is actively playing music, leading to an inconsistent and unpleasant user experience.

By having access to the "playerStateUpdate" event, developers can implement custom timeout handling strategies. For example, if the bot's timeout is about to expire, they can check if the player is actively playing and, if so, extend the timeout or take appropriate actions to prevent the player from being destroyed prematurely.

Benefits:

Adding the "playerStateUpdate" event would offer the following benefits:

  1. Improved Bot Reliability: Developers can implement better timeout management to avoid issues with active music playback.
  2. Enhanced Customization: The event allows for more sophisticated state-change handling tailored to specific bot requirements.
  3. Real-time Monitoring: Developers can have insights into player state changes as they occur, enabling them to respond accordingly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.