mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
ok that alot
This commit is contained in:
1 parent
df1a783fde
commit
5f33ee231d
17 files changed
+64
-47
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ export async function run(msg, data) {
|
||||
const guild = guildId ? this.client.guilds.get(String(guildId).replace(/\D/g, "")) : null;
|
||||
const conn = s.connection;
|
||||
const room = conn?.room;
|
||||
const roomState = room?.state ?? "no-room";
|
||||
const roomState = room?.connectionState ?? (room?.isConnected ? "connected" : "disconnected");
|
||||
const hasMediaPlayer = !!s._mediaPlayer && !s._mediaPlayer?.destroyed;
|
||||
return {
|
||||
name: channel?.name ?? "unknown",
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getGlobalColor } from "../src/MessageHandler.mjs";
|
||||
|
||||
export const command = new CommandBuilder()
|
||||
.setName("forceleave")
|
||||
.addAlias("fl")
|
||||
.addAliases("fl")
|
||||
.setDescription("Make Remix leave a channel even if you're not in it.")
|
||||
.setRequirement(r => r.addPermission("ManageChannels"))
|
||||
.setCategory("music")
|
||||
|
||||
+1
-2
@@ -11,8 +11,7 @@ export const command = new CommandBuilder()
|
||||
export async function run(message) {
|
||||
const description = this.t(message, "responses.invite.description");
|
||||
|
||||
const botUser = message.handler.client.user;
|
||||
|
||||
const botUser = this.client?.user;
|
||||
const botIcon = botUser?.displayAvatarURL?.() || null;
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
|
||||
+2
-2
@@ -69,8 +69,8 @@ export async function joinChannel(message, cid, cb = () => {}, ecb = () => {}) {
|
||||
} catch (_) { return "%"; }
|
||||
})();
|
||||
const desc = is247
|
||||
? this.t(message, "responses.join.autoLeaveInactive", { channel: activeChannelId })
|
||||
: this.t(message, "responses.join.autoLeaveInactive247", { channel: activeChannelId, prefix });
|
||||
? this.t(message, "responses.join.autoLeaveInactive247", { channel: activeChannelId, prefix })
|
||||
: this.t(message, "responses.join.autoLeaveInactive", { channel: activeChannelId });
|
||||
const embed = new EmbedBuilder().setColor(getGlobalColor())
|
||||
.setDescription(desc);
|
||||
message.channel.send({ embeds: [embed] });
|
||||
|
||||
+7
-7
@@ -380,7 +380,7 @@ export async function run(msg, data) {
|
||||
const statusEmoji = track.now ? "🎵 Now Playing" : "🕐 Last Played";
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setAuthor({ name: `${statusEmoji} on Last.fm`, icon_url: track.image || undefined })
|
||||
.setAuthor({ name: `${statusEmoji} on Last.fm`, iconURL: track.image || undefined })
|
||||
.setDescription(`**${track.name}** by **${track.artist}**\n[Open on Last.fm](${track.url})`)
|
||||
.setFooter({ text: `Last.fm: ${user.username}` });
|
||||
|
||||
@@ -406,7 +406,7 @@ export async function run(msg, data) {
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setAuthor({ name: `Last.fm Profile: ${info.name}`, icon_url: info.image?.[2]?.["#text"] || undefined, url: info.url })
|
||||
.setAuthor({ name: `Last.fm Profile: ${info.name}`, iconURL: info.image?.[2]?.["#text"] || undefined, url: info.url })
|
||||
.setDescription([
|
||||
`🎵 **${Utils.formatNumber(info.playcount ?? 0)}** scrobbles`,
|
||||
`👤 Registered: ${info.registered?.unixtime ? new Date(+info.registered.unixtime * 1000).toLocaleDateString() : "unknown"}`,
|
||||
@@ -504,7 +504,7 @@ export async function run(msg, data) {
|
||||
});
|
||||
}
|
||||
|
||||
return msg.reply({ embeds: [buildTrackList(user.username, "❤️ Loved Tracks", tracks)] });
|
||||
return msg.reply({ embeds: [buildTrackList(user.username, "❤️ Loved Tracks", tracks, false, prefix)] });
|
||||
}
|
||||
|
||||
// ── Top tracks ─────────────────────────────────────────────────────────
|
||||
@@ -527,7 +527,7 @@ export async function run(msg, data) {
|
||||
});
|
||||
}
|
||||
|
||||
return msg.reply({ embeds: [buildTrackList(user.username, "📊 Top Tracks", tracks, true)] });
|
||||
return msg.reply({ embeds: [buildTrackList(user.username, "📊 Top Tracks", tracks, true, prefix)] });
|
||||
}
|
||||
|
||||
// ── Leaderboard ─────────────────────────────────────────────────────
|
||||
@@ -648,7 +648,7 @@ export async function run(msg, data) {
|
||||
});
|
||||
}
|
||||
|
||||
return msg.reply({ embeds: [buildTrackList(user.username, "🕐 Recent Tracks", tracks)] });
|
||||
return msg.reply({ embeds: [buildTrackList(user.username, "🕐 Recent Tracks", tracks, false, prefix)] });
|
||||
}
|
||||
|
||||
default:
|
||||
@@ -684,7 +684,7 @@ export async function run(msg, data) {
|
||||
|
||||
// ── Track list embed builder ──────────────────────────────────────────────────
|
||||
|
||||
function buildTrackList(username, title, tracks, showPlaycount = false) {
|
||||
function buildTrackList(username, title, tracks, showPlaycount = false, prefix = "%") {
|
||||
const lines = tracks.map((t, i) => {
|
||||
const num = String(i + 1).padStart(2, " ");
|
||||
let name = t.name;
|
||||
@@ -700,7 +700,7 @@ function buildTrackList(username, title, tracks, showPlaycount = false) {
|
||||
.setColor(getGlobalColor())
|
||||
.setTitle(`${title} — ${username}`)
|
||||
.setDescription(desc)
|
||||
.setFooter({ text: `💡 Use %lastfm play loved to play these!` });
|
||||
.setFooter({ text: `💡 Use ${prefix}lastfm play loved to play these!` });
|
||||
}
|
||||
|
||||
// ── Leaderboard embed builder ─────────────────────────────────────────────────
|
||||
|
||||
+4
-8
@@ -1,6 +1,4 @@
|
||||
import { CommandBuilder } from "../src/CommandHandler.mjs";
|
||||
import { EmbedBuilder } from "@fluxerjs/core";
|
||||
import { getGlobalColor } from "../src/MessageHandler.mjs";
|
||||
|
||||
export const command = new CommandBuilder()
|
||||
.setName("remove")
|
||||
@@ -14,10 +12,8 @@ export const command = new CommandBuilder()
|
||||
export async function run(message, data) {
|
||||
const p = await this.getPlayer(message, false, false, false);
|
||||
if (!p) return;
|
||||
const res = p.remove(data.options[0].value - 1);
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setDescription(res)
|
||||
;
|
||||
message.reply({ embeds: [embed] });
|
||||
const index = data.get("index")?.value;
|
||||
if (index == null) return message.reply("Please provide a valid queue position.");
|
||||
const res = p.remove(index - 1);
|
||||
message.replyEmbed(res);
|
||||
}
|
||||
+7
-4
@@ -91,11 +91,14 @@ function getLivePlayerCount(playerMap) {
|
||||
if (conn) {
|
||||
const room = conn.room;
|
||||
if (room) {
|
||||
const state = room.state;
|
||||
// Use @livekit/rtc-node Node.js SDK API:
|
||||
// room.isConnected — boolean getter (true when connected)
|
||||
// room.connectionState — ConnectionState enum (0=disconnected, 1=connected, 2=reconnecting)
|
||||
// room.state does NOT exist in the Node.js SDK (browser-only API)
|
||||
const isConnected = room.isConnected;
|
||||
const connectionState = room.connectionState;
|
||||
// Explicitly dead states → skip
|
||||
if (state === "disconnected" || state === "failed" || state === 0) continue;
|
||||
// undefined = connected on some LiveKit builds (no persistent state prop)
|
||||
// "connected" = explicitly connected
|
||||
if (!isConnected && (connectionState === 0 || connectionState === "disconnected")) continue;
|
||||
}
|
||||
// conn exists but no room → still a valid LiveKit connection reference
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user