mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
initial push to remix-bot/fluxer
This commit is contained in:
commit
2820cc881c
63 files changed
+16005
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { CommandBuilder } from "../src/CommandHandler.mjs";
|
||||
import { EmbedBuilder } from "@fluxerjs/core";
|
||||
import { getGlobalColor } from "../src/MessageHandler.mjs";
|
||||
|
||||
export const command = new CommandBuilder()
|
||||
.setName("np")
|
||||
.setDescription("Request the name and url of the currently playing song.", "commands.np")
|
||||
.addAliases("current", "nowplaying");
|
||||
|
||||
export async function run(msg) {
|
||||
const p = await this.getPlayer(msg);
|
||||
if (!p) return;
|
||||
|
||||
const loadingEmbed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setDescription("⏳ Loading...")
|
||||
.toJSON();
|
||||
const loadingMsg = await msg.replyEmbed({ embeds: [loadingEmbed] });
|
||||
|
||||
const data = await p.nowPlaying();
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
.setDescription(data.msg);
|
||||
if (data.image) embed.setThumbnail(data.image);
|
||||
|
||||
loadingMsg.editEmbed({ embeds: [embed.toJSON()] }).catch(() => {});
|
||||
}
|
||||
Reference in new issue
Block a user