all repos — simple-discord-music-bot @ acb0e8e5e1fdb917e94a549726e93ad068837575

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

commands/stop.js (view raw)

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