Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forum Thread Post Creation "Cannot access 'data' before initialization" #1126

Closed
3 tasks done
sciencegirl100 opened this issue Apr 4, 2024 · 1 comment
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@sciencegirl100
Copy link

Which package has the bugs?

The core library

Issue description

When trying to call GuildForumThreadManager.create() the following error is thrown (personal data redacted for privacy):

C:\Users\username\Documents\Git\discord-tests\node_modules\discord.js-selfbot-v13\src\managers\GuildForumThreadManager.js:88
    data.attachments = attachmentsData;
    ^

ReferenceError: Cannot access 'data' before initialization
    at GuildForumThreadManager.create (C:\Users\username\Documents\Git\discord-tests\node_modules\discord.js-selfbot-v13\src\managers\GuildForumThreadManager.js:88:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.20.1

Code sample

const { Client } = require('discord.js-selfbot-v13');
const client = new Client();
client.on('ready', async () => {
  console.log(`${client.user.username} is ready!`);
  client.guilds.fetch(guildID).then(guild => {
    guild.channels.fetch(channelID).then(channel => {
        console.log(`${channel.name} ${channel.type} ${channel.threads.cache.size}`)
        channel.threads.create({
            name: "Test Title",
            autoArchiveDuration: 60,
            message: {
                content: "Test message contents"
            },
            reason: 'Test reason'
        }).then(thread => {
            console.dir(thread)
        })    
    })
  })
})
client.login(uToken);

Package version

3.1.4

Node.js version

18.20.1

Operating system

Windows 11 Build 22631.3374

Priority this issue should have

Medium (should be fixed soon)

Checklist

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

I have a pending fix, be on the lookout for a pull request

@sciencegirl100 sciencegirl100 added the bug Something isn't working label Apr 4, 2024
sciencegirl100 pushed a commit to sciencegirl100/discord.js-selfbot-v13-fork that referenced this issue Apr 4, 2024
aiko-chan-ai added a commit that referenced this issue Apr 4, 2024
Issue #1126 fix `data` initialization error
@sciencegirl100
Copy link
Author

Closing this issue as the PR was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant