Files
fluxer/commands/loop.mjs
T
NoLogicAlan 85f11fe34b fix: migrate all commands & src to @fluxerjs native API
- Replace replyEmbed/sendEmbed/editEmbed with reply/send/edit
  across all 33 command files and 5 src/ files
- Remove unnecessary .toJSON() on EmbedBuilder (Fluxer auto-converts)
- Fix voice channel type checks: channel_type === "VoiceChannel" → type === 2
- Add missing edit() and send() methods to Message/ChannelContext wrappers
- Fix filter command: reactions now update per page on navigation

Closes channel cache crash (guild.channels.cache.keys undefined)
2026-05-05 20:09:25 +03:00

25 lines
848 B
JavaScript

import { CommandBuilder } from "../src/CommandHandler.mjs";
import { EmbedBuilder } from "@fluxerjs/core";
import { getGlobalColor } from "../src/MessageHandler.mjs";
export const command = new CommandBuilder()
.setName("loop")
.setDescription("Toggle the looping of your queue/song.", "commands.loop")
.setCategory("music")
.addChoiceOption(opt =>
opt.setName("type")
.addChoices("queue", "song")
.setDescription("Specifies what loop should be toggled.", "options.loop.type")
.setRequired(true));
export async function run(message, data) {
const p = await this.getPlayer(message);
if (!p) return;
const res = p.loop(data.get("type").value);
const embed = new EmbedBuilder()
.setColor(getGlobalColor())
.setDescription(res)
;
message.reply({ embeds: [embed] });
}