A nicely formatted html transcript generator for discord.js-selfbot-v13.
npm install spectre-html-transcriptsspectre-html-transcripts (Selfbot v13)

!GitHub package.json version
!GitHub Repo stars
Spectre HTML Transcripts is a node.js module to generate nice looking HTML transcripts. Processes discord markdown like bold, _italics_, ~~strikethroughs~~, and more. Nicely formats attachments and embeds. Built in XSS protection, preventing users from inserting arbitrary html tags.
This module can format the following:
- Discord flavored markdown
- Uses discord-markdown-parser
- Allows for complex markdown syntax to be parsed properly
- Embeds
- System messages
- Join messages
- Message Pins
- Boost messages
- Slash commands
- Will show the name of the command in the same style as Discord
- Buttons
- Reactions
- Attachments
- Images, videos, audio, and generic files
- Replies
- Mentions
- Threads
This fork targets discord.js-selfbot-v13 (selfbot) and supports its v3.x releases.
Styles from @derockdev/discord-components.
Behind the scenes, this package uses React SSR to generate a static site.
This fork is tailored to work with discord.js-selfbot-v13 (v3.x). Install it in your project and ensure it's available as a peer dependency:
``bash`
npm install discord.js-selfbot-v13@^3.7.1
> Note: Using selfbots may violate Discord's Terms of Service. Use at your own risk.
---
This package is a complete overhaul (a fork) of the original discord-html-transcripts project by ItzDerock. All credits for the original concept and base code go to him. Please give the original project a star ⭐ and/or support the original creator on Ko-fi.
---
For support, please open a thread on this server or send a DM to qorp on Discord. / Pour tout support, ouvrez un thread sur ce serveur ou envoyez un DM à qorp sur Discord.
`js
const spectreTranscripts = require('spectre-html-transcripts');
// or (if using typescript) import * as spectreTranscripts from 'spectre-html-transcripts';
const channel = message.channel; // or however you get your TextChannel
// Must be awaited
const attachment = await spectreTranscripts.createTranscript(channel);
channel.send({
files: [attachment],
});
`
`js
const spectreTranscripts = require('spectre-html-transcripts');
// or (if using typescript) import * as spectreTranscripts from 'spectre-html-transcripts';
const messages = someWayToGetMessages(); // Must be Collection
const channel = someWayToGetChannel(); // Used for ticket name, guild icon, and guild name
// Must be awaited
const attachment = await spectreTranscripts.generateFromMessages(messages, channel);
channel.send({
files: [attachment],
});
`
Both methods of generating a transcript allow for an option object as the last parameter.
All configuration options are optional!
`js-1
const attachment = await discordTranscripts.createTranscript(channel, {
limit: -1, // Max amount of messages to fetch. recursively fetches.`
returnType: 'attachment', // Valid options: 'buffer' | 'string' | 'attachment' Default: 'attachment' OR use the enum ExportReturnType
filename: 'transcript.html', // Only valid with returnType is 'attachment'. Name of attachment.
saveImages: false, // Download all images and include the image data in the HTML (allows viewing the image even after it has been deleted) (! WILL INCREASE FILE SIZE !)
footerText: "Exported {number} message{s}", // Change text at footer, don't forget to put {number} to show how much messages got exported, and {s} for plural
callbacks: {
// register custom callbacks for the following:
resolveChannel: (channelId: string) => Awaitable
resolveUser: (userId: string) => Awaitable
resolveRole: (roleId: string) => Awaitable
resolveImageSrc: (
attachment: APIAttachment,
message: APIMessage
) => Awaitable
},
poweredBy: true, // Whether to include the "Powered by spectre-html-transcripts" footer
hydrate: true, // Whether to hydrate the html server-side
filter: (message) => true // Filter messages, e.g. (message) => !message.author.bot
});
`js`
const attachment = await discordTranscripts.generateFromMessages(messages, channel, {
// Same as createTranscript, except no limit or filter
});
If saveImages is set to true, all images will be downloaded and stored in the file _as-is_. You can optionally enable compression by installing the sharp module and setting the following options:
`js`
callbacks: {
resolveImageSrc: new TranscriptImageDownloader()
.withMaxSize(5120) // 5MB in KB
.withCompression(40, true) // 40% quality, convert to webp
.build(),
},
Note that, in a more advanced setup, you could store a copy of the files and return an entirely new URL pointing to your own image hosting site by implementing a custom resolveImageSrc function.
Give it a star ⭐ and/or support the original creator on Ko-fi.
This package is a complete overhaul (fork) of the original discord-html-transcripts` project by ItzDerock. All credits for the original concept and base code go to him. Thanks !