This commit is contained in:
NoLogicAlan committed 2026-05-21 18:51:37 +03:00
1 parent 2ee4a0a86d
commit 998040d33a
2 files changed
+9 -8

No files matched your search

+1 -1
View File
@@ -209,7 +209,7 @@ export async function run(msg, data) {
}
try {
const applied = p.applyTrackOption(result);
const applied = await p.applyTrackOption(result);
if (!applied) {
return msg.reply({ embeds: [new EmbedBuilder().setColor("#ff0000").setDescription("❌ Failed to apply alias.")] });
}
+8 -7
View File
@@ -2468,18 +2468,19 @@ export default class Player extends EventEmitter {
}
}
applyTrackOption(match) {
async applyTrackOption(match) {
if (!match || !this.connection || this._paused) return false;
if (match.startMs > 0) {
this.seekToPosition(match.startMs).catch((e) => {
logger.warn("[Player] TrackOptions apply-seek error:", e.message);
});
}
this._clearTrackEndTimer();
this._activeTrackOpt = null;
try {
await this.seekToPosition(match.startMs || 0);
} catch (e) {
logger.warn("[Player] TrackOptions apply-seek error:", e.message);
return false;
}
if (match.endMs > 0) {
const elapsedMs = Date.now() - this.startedPlaying;
const remainingMs = match.endMs - elapsedMs;