Open arturious opened 2 years ago
so that he sits in the role of a speaker and plays music 24/7
like radio)
yes, bot can play in stage _ 24/7: loop.js (works for both vc and stage)
const { SlashCommandBuilder } = require("@discordjs/builders")
const { MessageEmbed } = require("discord.js")
module.exports = {
data: new SlashCommandBuilder().setName("loop").setDescription("Loops the current song")
.addStringOption((option) => option.setName("mode").setDescription("Choose mode").setRequired(true).addChoices(
{ name: 'on', value: 'on' },
{ name: 'off', value: 'off' }
)),
run: async ({ client, interaction }) => {
let mode = false
const queue = client.player.getQueue(interaction.guildId)
const noSongPlayingEmbed = new MessageEmbed()
.setTitle("Error")
.setDescription("There is no song playing")
.setColor("RED")
if (!queue) {
await interaction.editReply({ embeds: [noSongPlayingEmbed] })
}
else {
switch (interaction.options.getString("mode")) {
case 'off':
mode = 0
break
case 'on':
mode = 1
break
}
mode = queue.setRepeatMode(mode)
mode = mode == 1 ? 'on' : 'off'
const modeEmbed = new MessageEmbed()
.setTitle("Loop Mode")
.setDescription(`Set loop mode is now **${mode}**`)
await interaction.editReply({ embeds: [modeEmbed] })
}
}
}
can he play in stage channel?