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)
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 anInvalidCastException
. This is done here: https://github.com/Yucked/Victoria/blob/v5/src/LavaPlayer.cs#L221.For example, my child class:
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