aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
751 stars 160 forks source link

secretbox.methods.close is not a function #1238

Closed Probabilities closed 3 weeks ago

Probabilities commented 4 weeks ago

Which package has the bugs?

The core library

Issue description

Just run the code and it will throw the error.

Code sample

const { Client } = require('discord.js-selfbot-v13');
const client = new Client();
const fs = require('fs');
const ytdl = require('@distube/ytdl-core');

client.on('ready', async () => {
    console.log(`${client.user.username} is ready!`);

    const channel = client.channels.cache.get('x');
    const connection = await client.voice.joinChannel(channel)

    connection.playAudio(
        ytdl('https://www.youtube.com/watch?v=3KadWjpqDXs', {
            quality: 'highestaudio',
        }),
    )
})

client.login('x.GfFMbv.x-k9MN9PlI');

Package version

3.3.0

Node.js version

18.0.0

Operating system

Windows 10

Priority this issue should have

High (immediate attention needed)

Checklist

Additional Information

No response

aiko-chan-ai commented 4 weeks ago

image

To prevent errors like this from happening again in the future, I will preinstall tweetnacl just like in discord.js v12.

Probabilities commented 4 weeks ago

how do I fix?

002-sans commented 3 weeks ago

as she said, do npm i tweetnacl (it worked for me)

aiko-chan-ai commented 3 weeks ago

Because Discord has made some updates to the RTP header in the payload, it means that tweetnacl no longer works. Use sodium or libsodium-wrappers as a replacement.