[Bug]: SkipAsync does not work for child classes of LavaTrack
DrDevinRX opened this issue · 1 comments
DrDevinRX commented
Describe your issue in as much detail as possible
If you use a child class of LavaTrack
and put it in the queue, SkipAsync
will throw an InvalidCastException
.
This is done here: https://github.com/Yucked/Victoria/blob/v5/src/LavaPlayer.cs#L221.
For example, my child class:
public class MuseTrack : LavaTrack
{
public IGuildUser Requester { get; }
public MuseTrack(LavaTrack lavaTrack, IGuildUser requester) : base(lavaTrack)
{
Requester = requester;
}
}
This has worked in older version of v5, but after updating to the latest, I can't skip tracks and it throws the exception.
My suggestion would be to use pattern matching instead of using GetType
.
if (lavaTrack is not LavaTrack)
Version
v5 (Latest)
Version
GitHub's latest
Relevant log output
No response
Yucked commented
Pushed it recent update