mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
fix(ui,music): handle deleted message replies and safe null duration during restore
- Fall back to channel send when replyingTo message was deleted (UNKNOWN_MESSAGE 404) - Safely handle null duration in dashboard convertVideo and player embed during session restore - Protect lastfm scrobbler and search mixins from null duration properties
This commit is contained in:
1 parent
7c5fb1e468
commit
a0d6f32ea8
8 files changed
+49
-12
No files matched your search
@@ -7,7 +7,6 @@
|
||||
|
||||
import { Utils } from "../../src/utils/Utils.mjs";
|
||||
import { EmbedBuilder } from "@fluxerjs/core";
|
||||
import { getGlobalColor } from "../../src/ui/index.mjs";
|
||||
import { STATES, PROGRESS } from "./consts.mjs";
|
||||
|
||||
/**
|
||||
@@ -30,7 +29,7 @@ export function buildPlayerEmbed(bot, msg, player, timeout, state = {}) {
|
||||
if (current?.duration && player.startedPlaying) {
|
||||
const elapsed = Date.now() - player.startedPlaying;
|
||||
const totalMs = typeof current.duration === "object"
|
||||
? (current.duration.seconds ?? 0) * 1000
|
||||
? (current.duration?.seconds ?? 0) * 1000
|
||||
: current.duration;
|
||||
|
||||
const bar = Utils.progressBar(elapsed, totalMs, 20, PROGRESS.filled, PROGRESS.empty, isPlaying ? PROGRESS.indicator : PROGRESS.filled);
|
||||
|
||||
Reference in new issue
Block a user