safeness-html-transcripts
v1.1.0
Published
A nicely formatted html transcript generator for discord.js.
Downloads
285
Maintainers
Readme
safeness-html-transcripts
Safeness HTML Transcripts is a complete overhaul of the discord-html-transcript module. It's a Node.js module designed to generate HTML backups of Discord conversations, including direct messages (DMs) and group DMs. It processes Discord formatting such as bold, italics, ~~strikethroughs~~, and more. It also formats attachments and embeds.
This module can format the following:
- Discord flavored markdown
- Embeds
- System messages
- Slash commands
- Buttons
- Reactions
- Attachments
- Images, videos, audio, and generic files
- Replies
- Mentions
- Threads
This module is designed to work with discord.js-selfbot-v13 only.
Styles from @derockdev/discord-components.
Behind the scenes, this package uses React SSR to generate a static site.
📝 Usage
Example usage with the built-in message fetcher
const { createTranscript } = require('safeness-html-transcripts');
const channel = message.channel; // or however you get your channel
// Must be awaited
const attachment = await createTranscript(channel);
// Save the transcript to a file
const fs = require('fs');
fs.writeFileSync('transcript.html', attachment);
Configuration
The transcript generation method allows for an options object as the last parameter.
All configuration options are optional!
const attachment = await createTranscript(channel, {
limit: -1, // Max number of messages to fetch. `-1` fetches recursively.
fileName: 'transcript.html', // Name of the backup file.
saveImages: false, // Download all images and include image data in the HTML (allows viewing the image even after deletion) (! WILL INCREASE FILE SIZE !)
poweredBy: false // Whether to include the "Powered by discord-html-transcripts" footer
});
⚠️ Warning
Using selfbots (like this module) may be against Discord's Terms of Service. Use this module at your own risk.
🤝 Enjoy the package?
Give it a star ⭐ and/or support the original creator on ko-fi
This package is a complete overhaul of the original discord-html-transcripts package by ItzDerock. All credits for the original concept and base code go to him.