mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
fixing
This commit is contained in:
1 parent
2ee4a0a86d
commit
998040d33a
2 files changed
+9
-8
No files matched your search
@@ -209,7 +209,7 @@ export async function run(msg, data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const applied = p.applyTrackOption(result);
|
const applied = await p.applyTrackOption(result);
|
||||||
if (!applied) {
|
if (!applied) {
|
||||||
return msg.reply({ embeds: [new EmbedBuilder().setColor("#ff0000").setDescription("❌ Failed to apply alias.")] });
|
return msg.reply({ embeds: [new EmbedBuilder().setColor("#ff0000").setDescription("❌ Failed to apply alias.")] });
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-7
@@ -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 || !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._clearTrackEndTimer();
|
||||||
this._activeTrackOpt = null;
|
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) {
|
if (match.endMs > 0) {
|
||||||
const elapsedMs = Date.now() - this.startedPlaying;
|
const elapsedMs = Date.now() - this.startedPlaying;
|
||||||
const remainingMs = match.endMs - elapsedMs;
|
const remainingMs = match.endMs - elapsedMs;
|
||||||
|
|||||||
Reference in new issue
Block a user