mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
hotfix
This commit is contained in:
1 parent
3a72e46775
commit
5558cf8282
9 files changed
+37
-12
No files matched your search
+2
-2
@@ -65,7 +65,7 @@ export async function run(message, data) {
|
||||
const elapsed = p.getCurrentElapsedDuration();
|
||||
const total = p.getCurrentDuration();
|
||||
const link = current.spotifyUrl || current.url || "";
|
||||
let title = current.title;
|
||||
let title = current.title ?? "Unknown";
|
||||
if (title.length > 50) title = title.slice(0, 47) + "...";
|
||||
const titleFmt = link ? `[${title}](${link})` : title;
|
||||
|
||||
@@ -84,7 +84,7 @@ export async function run(message, data) {
|
||||
const index = String(start + i + 1).padStart(2, " ");
|
||||
const dur = vid.duration ? p.getDuration(vid.duration) : "?:??";
|
||||
const link = vid.spotifyUrl || vid.url || "";
|
||||
let title = vid.title;
|
||||
let title = vid.title ?? "Unknown";
|
||||
if (title.length > 45) title = title.slice(0, 42) + "...";
|
||||
title = link ? `[${title}](${link})` : title;
|
||||
const upNext = (start + i === 0) ? " ▶" : "";
|
||||
|
||||
+13
-1
@@ -243,10 +243,22 @@ export async function run(msg) {
|
||||
reply = player.pause();
|
||||
break;
|
||||
|
||||
case "stop":
|
||||
case "stop": {
|
||||
const hadCurrent = !!player.queue.getCurrent();
|
||||
player._lastPlayedTrack = player.queue.getCurrent() ?? player._lastPlayedTrack;
|
||||
player.queue.reset();
|
||||
player._activeTrackOpt = null;
|
||||
player._clearTrackEndTimer?.();
|
||||
player._bridgeStop?.();
|
||||
player._paused = false;
|
||||
player._pausedAt = null;
|
||||
if (hadCurrent) {
|
||||
player.emit("stopplay");
|
||||
if (!player._is247Enabled?.()) player._startInactivityTimer?.();
|
||||
}
|
||||
reply = this.t(msg, "responses.player.stoppedCleared");
|
||||
break;
|
||||
}
|
||||
|
||||
case "skip":
|
||||
reply = player.skip();
|
||||
|
||||
+15
-7
@@ -53,8 +53,10 @@ export async function run(msg, data) {
|
||||
|
||||
let desc = `📻 **Radio Stations (Page ${page + 1}/${totalPages})**\n\n`;
|
||||
pickable.forEach((r, i) => {
|
||||
desc += `${NUMBER_EMOJIS[i]} **${r.detailedName}** (\`${r.name}\`)\n`;
|
||||
desc += ` ${r.description.replaceAll("\n", "\n ")}\n\n`;
|
||||
const displayName = r.detailedName ?? r.name ?? "Station";
|
||||
const stationDesc = String(r.description ?? "").replaceAll("\n", "\n ");
|
||||
desc += `${NUMBER_EMOJIS[i]} **${displayName}** (\`${r.name ?? "station"}\`)\n`;
|
||||
desc += ` ${stationDesc}\n\n`;
|
||||
});
|
||||
desc += `⬅️ Previous ➡️ Next ❌ Cancel`;
|
||||
|
||||
@@ -126,9 +128,9 @@ export async function run(msg, data) {
|
||||
}
|
||||
|
||||
if (input) {
|
||||
const radio = radios.find(r => r.name.toLowerCase() === input);
|
||||
const radio = radios.find(r => String(r.name ?? "").toLowerCase() === input);
|
||||
if (!radio) {
|
||||
const names = radios.map(r => `\`${r.name}\``).join(", ");
|
||||
const names = radios.map(r => `\`${r.name ?? "station"}\``).join(", ");
|
||||
return msg.reply(this.t(msg, "responses.radio.unknownStation", { station: input, stations: names }));
|
||||
}
|
||||
return playStation(this, msg, radio);
|
||||
@@ -157,12 +159,18 @@ async function playStation(ctx, msg, radio, editTarget = null) {
|
||||
else p.playRadio(radio);
|
||||
|
||||
const prefix = ctx.handler.getPrefix(msg?.channel?.channel?.guildId ?? msg?.message?.guildId);
|
||||
const stationName = radio.detailedName ?? radio.name ?? "Radio Station";
|
||||
const stationUrl = radio.author?.url ?? "";
|
||||
const stationDesc = String(radio.description ?? "");
|
||||
const stationLine = stationUrl
|
||||
? `**[${stationName}](${stationUrl})**\n\n`
|
||||
: `**${stationName}**\n\n`;
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setTitle(`📻 ${radio.detailedName}`)
|
||||
.setTitle(`📻 ${stationName}`)
|
||||
.setDescription(
|
||||
`**[${radio.detailedName}](${radio.author.url})**\n\n` +
|
||||
`${radio.description}\n\n` +
|
||||
stationLine +
|
||||
`${stationDesc}\n\n` +
|
||||
`_Use \`${prefix}skip\` to stop the radio, or \`${prefix}radio list\` to switch stations._`
|
||||
)
|
||||
;
|
||||
|
||||
Reference in new issue
Block a user