JSPM

@ronaldmiranda/discord-message-transcript

1.1.4-fix
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q30883F
  • License Apache-2.0

Package Exports

  • @ronaldmiranda/discord-message-transcript

Readme

discord-message-transcript

Generate JSON or HTML transcripts from Discord channels with visual fidelity.

Designed for bots and backend services that need reliable message exports.


๐Ÿง  Use cases

This package is ideal for:

  • ๐ŸŽซ Ticket systems
  • ๐Ÿ›ก๏ธ Moderation logs
  • ๐Ÿงพ Audit trails
  • ๐Ÿ’พ Channel backups

๐Ÿ“ฆ Packages

This project provides two packages:

discord-message-transcript (this package)

  • Fetches messages directly from Discord
  • Requires discord.js
  • Outputs HTML or JSON transcripts
  • Handles permissions, pagination, and message formatting

๐Ÿ‘‰ Most users should only install this package.


discord-message-transcript-base

  • Renderer-only
  • โŒ No discord.js dependency
  • Converts transcript JSON โ†’ HTML
  • Intended for:
    • Frontend rendering
    • Static sites
    • Post-processing stored transcripts

โœจ Key features

  • Discord-like rendering
  • Single-file HTML output
  • Lightweight JSON format
  • Optional image embedding
  • Markdown + syntax highlighting
  • No tracking or telemetry

๐Ÿ” Permissions

The bot must have access to the channel and the following permissions:

  • ViewChannel
  • ReadMessageHistory

Required intents depend on context:

  • DMs: DirectMessages
  • Guild channels: Guilds, GuildMessages

๐Ÿงช Usage & API

Installation

npm install discord-message-transcript
yarn add discord-message-transcript
pnpm add discord-message-transcript

Functions

createTranscript(channel, options)

import { createTranscript } from "discord-message-transcript";

const transcript = await createTranscript(channel, {
  returnType: "attachment",
  returnFormat: "HTML"
});

await interaction.reply({ files: [transcript] });

renderHTMLFromJSON(jsonString, options)

import { renderHTMLFromJSON } from "discord-message-transcript";

const html = await renderHTMLFromJSON(jsonTranscriptString, {
  returnType: "string",
  selfContained: true
});

This project is not affiliated with Discord Inc.

You are responsible for ensuring compliance with:


๐Ÿ“œ License

Licensed under the Apache License 2.0.
See the LICENSE file for more information.