all repos — simple-discord-music-bot @ 394cdf4f8bb25b2fdc6eb4a21d67aa1b4bff9db8

A Discord bot making use of discord.js and play-yt.

commands/stop.js (view raw)

 1const { SlashCommandBuilder } = require("discord.js");
 2const { getChannel } = require("../functions/music");
 3
 4module.exports = {
 5  data: new SlashCommandBuilder()
 6    .setName("stop")
 7    .setDescription("Stop the music."),
 8
 9  async execute(interaction) {
10
11    channel = await getChannel(interaction);
12    if (typeof channel == "string")
13      return await interaction.reply({ content: channel, ephemeral: true });
14
15    player.stop();
16    return await interaction.reply({ content: "Stopped.", ephemeral: true });
17  },
18};