Dimensional FunDF
Dimensional Fun3y ago
21 replies
Naseem

ReferenceError: sendWithDiscordLib is not defined

I am getting this error:
Uncaught Promise Rejection ReferenceError: sendWithDiscordLib is not defined
    at Node.sendGatewayPayload (C:\Users\nasee\Desktop\projects\yuki\src\index.js:41:42)
    at Player.connect (C:\Users\nasee\Desktop\projects\yuki\node_modules\lavaclient\dist\lib\Player.js:49:19)
    at Object.run (C:\Users\nasee\Desktop\projects\yuki\src\slashCommands\music\play.js:14:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)


Here is my code of play command:
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
    category: 'music',
    data: new SlashCommandBuilder()
        .setName('play')
        .setDescription('Play a song!')
        .addStringOption(option => option.setName('name').setDescription('Name of the song.').setRequired(true)),
    run: async (client, interaction) => {
        const results = await client.music.rest.loadTracks("ytsearch:kurdo business narcotic");
        console.log(interaction.member.voice)
        await client.music
        .createPlayer(interaction.guildId)
        .connect(interaction.member.voice.channelId)
        .play(results.tracks[0]);
    },
};
Was this page helpful?