mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
test
This commit is contained in:
1 parent
3ea4ac660e
commit
9366bbe95a
2 files changed
+35
-3
No files matched your search
@@ -184,6 +184,26 @@ export class Dashboard {
|
||||
return { message: "Adding to queue" };
|
||||
}
|
||||
|
||||
case "leave": {
|
||||
if (!user) return { error: "Invalid user" };
|
||||
const channelId = params.data.channel;
|
||||
if (!channelId) return { error: "Missing channel ID" };
|
||||
const player = this._getPlayerById(channelId);
|
||||
if (!player) return { error: "Player not found" };
|
||||
const authErr = this._authorizePlayerControl(user, player);
|
||||
if (authErr) return { error: authErr };
|
||||
try {
|
||||
await player.leave();
|
||||
player.destroy();
|
||||
const activeChannelId = player._channelId ?? channelId;
|
||||
this.remix.players.playerMap.delete(activeChannelId);
|
||||
return { message: "Left channel" };
|
||||
} catch (e) {
|
||||
logger.dashboard("[Dashboard] Leave error:", e.message);
|
||||
return { error: "Failed to leave channel: " + e.message };
|
||||
}
|
||||
}
|
||||
|
||||
case "testConnection": {
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user