mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
- 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)
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import { CommandBuilder } from "../src/CommandHandler.mjs";
|
|
import { EmbedBuilder } from "@fluxerjs/core";
|
|
import { getGlobalColor } from "../src/MessageHandler.mjs";
|
|
|
|
export const command = new CommandBuilder()
|
|
.setName("skip")
|
|
.setDescription("Skip the current playing song.", "commands.skip")
|
|
.addAliases("s")
|
|
.setCategory("music");
|
|
|
|
export async function run(message) {
|
|
const p = await this.getPlayer(message);
|
|
if (!p) return;
|
|
|
|
const current = p.queue.getCurrent();
|
|
const skippedTitle = current?.title ?? null;
|
|
const skippedLink = current ? (current.spotifyUrl || current.url || "") : "";
|
|
|
|
const err = p.skip();
|
|
if (err && err.includes("nothing playing")) {
|
|
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(err);
|
|
return message.reply({ embeds: [embed] });
|
|
}
|
|
|
|
const desc = skippedTitle
|
|
? `⏭️ Skipped [${skippedTitle}](${skippedLink})`
|
|
: "⏭️ Skipped";
|
|
|
|
const embed = new EmbedBuilder()
|
|
.setColor(getGlobalColor())
|
|
.setDescription(desc)
|
|
;
|
|
message.reply({ embeds: [embed] });
|
|
}
|