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

Define Maximum Output File Size for Discord HTML Transcripts #166

Closed
FabienBounoir opened this issue Jan 8, 2024 · 1 comment · Fixed by #169
Closed

Define Maximum Output File Size for Discord HTML Transcripts #166

FabienBounoir opened this issue Jan 8, 2024 · 1 comment · Fixed by #169

Comments

@FabienBounoir
Copy link
Contributor

Hello,

I've been using the "discord-html-transcripts" package and I'm pleased with its performance. However, I have a suggestion for improvement.

Feature Request:
Integrate a functionality to define the maximum size of the output file when creating a transcript with the base64 conversion of images. This would ensure that if the total size of the images exceeds the defined limit, subsequent images will not be converted. This feature would be beneficial for resource management when sending the transcript via a Discord bot to a channel.

Rationale:
By having the ability to set a maximum file size, users can optimize resource utilization and avoid concerns about file size when sharing transcripts through Discord channels. This enhancement would contribute to better overall performance and efficiency.

Thank you for considering this suggestion.

Best regards,
Bouns

@ItzDerock
Copy link
Owner

I will probably add some sort of callback for saving images so users can create their own functions to add new limitations or other features (see my response in #128).

Along with that, I'll have some sort of builder for the basic limitations, so expect an api like:

createTranscript(channel, {
    callbacks: {
        resolveImageSrc: new TranscriptImageDownloader()
            .withMaxSize(5_000_000) /* 5mb in bytes */
            .withCompression() /* package will recompress the image */
            .build()
    }
});

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

Successfully merging a pull request may close this issue.

2 participants