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

An unofficial discord.js fork for creating selfbots

Home Page:https://discordjs-self-v13.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

sciencegirl100 opened this issue · comments

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

Closing this issue as the PR was merged