not playing anything

const { Client, SlashCommandBuilder } = require('discord.js')
const { createAudioPlayer, createAudioResource, generateDependencyReport, joinVoiceChannel } = require('@discordjs/voice');

console.log(generateDependencyReport());

module.exports = {
data: new SlashCommandBuilder()
.setName('anthem')
.setDescription('Let the anthem play!'),
async execute(interaction, client) {

const channel = client.channels.cache.get('1033420771294461952');
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});

const player = createAudioPlayer();
const subscription = connection.subscribe(player);
const resource = createAudioResource('../Anthem.mp3');

connection.subscribe(player);
player.play(resource);

if (subscription) {
// Unsubscribe after 5 seconds (stop playing audio on the voice connection)
setTimeout(() => subscription.unsubscribe(), 5_000);
}


interaction.reply("Anthem playing in <#1033420771294461952>")

},
};
const { Client, SlashCommandBuilder } = require('discord.js')
const { createAudioPlayer, createAudioResource, generateDependencyReport, joinVoiceChannel } = require('@discordjs/voice');

console.log(generateDependencyReport());

module.exports = {
data: new SlashCommandBuilder()
.setName('anthem')
.setDescription('Let the anthem play!'),
async execute(interaction, client) {

const channel = client.channels.cache.get('1033420771294461952');
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});

const player = createAudioPlayer();
const subscription = connection.subscribe(player);
const resource = createAudioResource('../Anthem.mp3');

connection.subscribe(player);
player.play(resource);

if (subscription) {
// Unsubscribe after 5 seconds (stop playing audio on the voice connection)
setTimeout(() => subscription.unsubscribe(), 5_000);
}


interaction.reply("Anthem playing in <#1033420771294461952>")

},
};
I'm not sure why first time using this so I don't know if I'm missing anything either?
4 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MrEthλn
MrEthλn2y ago
fixed now
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MrEthλn
MrEthλn2y ago
I was getting the file how I normally would get a text file idk why it has to be different