forked from Androz2091/discord-music-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
np.js
40 lines (33 loc) · 1.19 KB
/
np.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const { SlashCommand } = require('slash-create');
module.exports = class extends SlashCommand {
constructor(creator) {
super(creator, {
name: "np",
description: "See what's currently being played",
guildIDs: process.env.DISCORD_GUILD_ID ? [ process.env.DISCORD_GUILD_ID ] : undefined
});
}
async run (ctx) {
const { client } = require('..');
await ctx.defer();
const queue = client.player.getQueue(ctx.guildID);
if (!queue || !queue.playing) return void ctx.sendFollowUp({ content: "❌ | No music is being played!" });
const progress = queue.createProgressBar();
const perc = queue.getPlayerTimestamp();
return void ctx.sendFollowUp({
embeds: [
{
title: "Now Playing",
description: `🎶 | **${queue.current.title}**! (\`${perc.progress}%\`)`,
fields: [
{
name: "\u200b",
value: progress
}
],
color: 0xffffff
}
]
});
}
}