Skip to main content

Options Reference

Everything here is optional. These work with both createTranscript() and generateTranscriptHtml() unless noted otherwise.

Fetch Options​

info

These options only apply to createTranscript().

OptionTypeDefaultDescription
limitnumber100Number of messages to fetch (max: 5000)
beforestring-Fetch messages before this message ID
afterstring-Fetch messages after this message ID
filenamestringautoCustom filename for the output
returnBufferboolean-Return as Buffer
resolveRolesbooleantrueResolve member roles for colored usernames

Display Options​

OptionTypeDefaultDescription
theme"dark" | "light""dark"Color theme
compactbooleanfalseCompact message layout
dateFormat"relative" | "absolute" | "both""absolute"Timestamp format
maxImageWidthnumber400Maximum image width in pixels
showReactionsbooleantrueShow message reactions
showAvatarsbooleantrueShow user avatars
showTimestampsbooleantrueShow message timestamps
showRoleColorsbooleantrueColor usernames by role
showEmbedsbooleantrueRender embeds
showAttachmentsbooleantrueRender attachments
showThreadsbooleantrueShow thread indicators
showHeaderbooleantrueShow channel header
localestring"en-US"Locale for dates, times and numbers (BCP 47 tag, e.g. "de-DE")
timeZonestringsystem zoneIANA time zone for all timestamps, e.g. "Europe/Berlin" or "UTC"

Locale and time zone​

By default, dates are formatted in US English using the time zone of the machine that generates the transcript. A bot hosted in one region will therefore stamp messages with that region's clock. Set both options to control what readers see:

const html = generateTranscriptHtml(data, {
locale: "en-GB",
timeZone: "Europe/London",
});

timeZone also decides where day separators fall and how the "Activity by Hour" chart is bucketed. An unrecognised locale or time zone falls back to the default instead of throwing. Relative times ("3 hours ago") and interface labels stay in English.

Feature Toggles​

All of these are off by default. Turn on the ones you want.

OptionTypeDefaultDescription
enableSearchbooleanfalseAdd message search bar
enableDateNavbooleanfalseAdd jump-to-date navigation
enableThemeTogglebooleanfalseAdd a light/dark toggle button
showUserStatsbooleanfalseShow user statistics section
enableCopyButtonbooleanfalseShow copy button on hover
collapsibleEmbedsbooleanfalseMake embeds collapsible
enableLightboxbooleanfalseClick images to view full-size
expandThreadsbooleanfalseShow expandable thread messages
embedMediabooleanfalseEmbed all media as base64 data URIs for offline/permanent transcripts
includeJsonbooleanfalseEmbed raw JSON data in output
messagesPerPagenumber-Enable pagination (messages per page)

Customization​

OptionTypeDefaultDescription
customCssstring-Additional CSS to inject
fontFamilystring-Override font family
pageTitlestringautoCustom page <title>
faviconUrlstring-Custom favicon URL
customRenderersRecord<number, Function>-Custom component renderers

Custom CSS Example​

const html = generateTranscriptHtml(data, {
customCss: `
.discord-dark {
--dc-bg-primary: #1a1a2e;
--dc-accent-primary: #e94560;
}
`,
});

Custom Font Example​

const html = generateTranscriptHtml(data, {
fontFamily: "'Fira Code', monospace",
});

All Options at a Glance​

const html = generateTranscriptHtml(data, {
// Display
theme: "dark",
compact: false,
dateFormat: "absolute",
maxImageWidth: 400,
showReactions: true,
showAvatars: true,
showTimestamps: true,
showRoleColors: true,
showEmbeds: true,
showAttachments: true,
showThreads: true,
showHeader: true,
locale: "en-US",
timeZone: undefined, // the generating machine's zone

// Feature toggles
enableSearch: false,
enableThemeToggle: false,
enableDateNav: false,
showUserStats: false,
enableCopyButton: false,
collapsibleEmbeds: false,
enableLightbox: false,
expandThreads: false,
embedMedia: false,
includeJson: false,
messagesPerPage: undefined,

// Customization
customCss: undefined,
fontFamily: undefined,
pageTitle: undefined,
faviconUrl: undefined,
customRenderers: undefined,
});