Initial Code
This commit is contained in:
28
src/commands/music/stop.ts
Normal file
28
src/commands/music/stop.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import BotCommand from "../../libs/BotCommand";
|
||||
import BotClient from "../../libs/BotClient";
|
||||
import { ChatInputCommandInteraction, GuildMember } from "discord.js";
|
||||
|
||||
export default class StopCommand extends BotCommand {
|
||||
constructor() {
|
||||
super("stop", "Stop Command", "/stop");
|
||||
}
|
||||
|
||||
override async execute(Discord: any, client: BotClient, interaction: ChatInputCommandInteraction): Promise<any> {
|
||||
const member = interaction.member as GuildMember;
|
||||
|
||||
if(!member?.voice?.channel) {
|
||||
return await interaction.reply({ content: "❌ | You need to be in a voice channel!" });
|
||||
}
|
||||
|
||||
const queue = client.distube.getQueue(interaction);
|
||||
if(!queue) return await interaction.reply({ content: `❌ | There is no music playing!` });
|
||||
|
||||
client.distube.stop(interaction);
|
||||
|
||||
const embed = new Discord.EmbedBuilder()
|
||||
.setDescription(` Successfully **Stopped** the music.`)
|
||||
.setFooter({ text: `Request by ${interaction.user.tag}`, iconURL: interaction.user.displayAvatarURL() });
|
||||
|
||||
return await interaction.reply({ embeds: [embed] });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user