mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
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)
This commit is contained in:
1 parent
19820e7209
commit
85f11fe34b
38 files changed
+395
-314
No files matched your search
@@ -15,7 +15,7 @@ export const command = new CommandBuilder()
|
||||
);
|
||||
|
||||
function embed(desc) {
|
||||
return { embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(desc).toJSON()] };
|
||||
return { embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(desc)] };
|
||||
}
|
||||
|
||||
function cleanId(value) {
|
||||
@@ -24,13 +24,13 @@ function cleanId(value) {
|
||||
|
||||
export async function run(msg, data) {
|
||||
const cid = cleanId(data.get("channelId").value);
|
||||
const targetChannel = this.client.channels.cache.get(cid);
|
||||
if (!targetChannel) return msg.replyEmbed(embed("❌ Channel not found."));
|
||||
const targetChannel = this.client.channels.get(cid);
|
||||
if (!targetChannel) return msg.reply(embed("❌ Channel not found."));
|
||||
if (cleanId(msg.message.guildId) !== cleanId(targetChannel.guildId))
|
||||
return msg.replyEmbed(embed("❌ This command has to be run in the same server as the voice channel."));
|
||||
return msg.reply(embed("❌ This command has to be run in the same server as the voice channel."));
|
||||
const p = this.players.playerMap.get(cid)
|
||||
?? [...this.players.playerMap.values()].find((player) => cleanId(player?._channelId) === cid);
|
||||
if (!p) return msg.replyEmbed(embed("❌ Player not found."));
|
||||
if (!p.connection) return msg.replyEmbed(embed("❌ Player not initialized."));
|
||||
if (!p) return msg.reply(embed("❌ Player not found."));
|
||||
if (!p.connection) return msg.reply(embed("❌ Player not initialized."));
|
||||
await this.players.leave(msg, cid);
|
||||
}
|
||||
Reference in new issue
Block a user