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

Error while doing transcription (read properties of null) #135

Open
MinerPL opened this issue May 7, 2023 · 1 comment
Open

Error while doing transcription (read properties of null) #135

MinerPL opened this issue May 7, 2023 · 1 comment
Labels
bug/confirmed reproduceable bugs

Comments

@MinerPL
Copy link

MinerPL commented May 7, 2023

A copy of the message from the discord server:

When trying to perform a transcription from a messageDeleteBulk event, a problem pops up reading the author.id value (author is null?)

Error

TypeError: Cannot read properties of null (reading 'id')
    at buildProfiles (C:\Users\MinerPL\IdeaProjects\MightyBot\node_modules\discord-html-transcripts\dist\utils\buildProfiles.js:11:30)
    at renderMessages (C:\Users\MinerPL\IdeaProjects\MightyBot\node_modules\discord-html-transcripts\dist\generator\index.js:63:56)
    at generateFromMessages (C:\Users\MinerPL\IdeaProjects\MightyBot\node_modules\discord-html-transcripts\dist\index.js:43:48)
    at MightyBot.<anonymous> (C:\Users\MinerPL\IdeaProjects\MightyBot\events\logs\messageDeleteBulk.js:14:27)

Code

    const transcript = await generateFromMessages(messages.values(), channel, {
        returnType: 'attachment',
        filename: `MessageDeleteBulk-${channel.id}-${Date.now()}.html`,
        footerText: false,
        saveImages: false,
        poweredBy: true,
    });
@ItzDerock ItzDerock added the bug/confirmed reproduceable bugs label May 7, 2023
@SerenModz21
Copy link
Contributor

SerenModz21 commented Oct 2, 2023

The message author is null when the message is a partial. Since its the messageDeleteBulk event, all you can do is filter out those partial messages. They sadly cannot be fetched because those messages have already been deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed reproduceable bugs
Projects
None yet
Development

No branches or pull requests

3 participants