Skip to content

omardiaadev/discord-html-transcript

Repository files navigation

discord-html-transcript

Generate natively styled Discord chat logs

Maven Version License Discord

Table of Contents

Features

  • Beautiful UI: Modern styling that replicates the look and feel of the Discord desktop client.
  • Asynchronous: Built with CompletableFuture for high performance.
  • 100% Offline: Built to contain all information in one file.

Supported Components

  • ComponentsV2 NEW
  • Markdown: Standard Markup, Mentions, Custom Emojis, and more.
  • Message Accessories: Attachments, Embeds, Polls, References, and more.

Important

This project is not affiliated with Discord Inc.

Preview

Preview

Usage

There are 3 ways to use this tool:

1. Library (Recommended)

Use the referenced library if you're building your bot with any of the following APIs:

API Library
JDA

Java Discord API

discord-html-transcript-jda
discord.js

discord.js

discord-html-transcript-discordjs
discord.py

discord.py

WIP

2. Installation

For custom Java implementations, you can install the core library directly via Maven or Gradle:

Prerequisites

  • Java 17+

Maven

<dependency>
  <groupId>dev.omardiaa</groupId>
  <artifactId>discord-html-transcript-core</artifactId>
  <version>0.1.0-beta.6</version>
</dependency>

Gradle

implementation("dev.omardiaa:discord-html-transcript-core:0.1.0-beta.6")

3. Standalone API

This section refers to discord-html-transcript-server.

You can download and run the executable as a standalone web server.

Configuration

Environment Variables
Variable Description
DISCORD_HTML_TRANSCRIPT_HOST Specifies a custom host for the server.
(default: 127.0.0.1)
DISCORD_HTML_TRANSCRIPT_PORT Specifies a custom port for the server.
(default: 7000)
DISCORD_HTML_TRANSCRIPT_API_KEY Specifies a secret key to authenticate client requests.

Usage

Headers
Header Description
Server-Version Validates the server version required by the client to ensure compatibility.
Required.
Authorization Authenticates client requests.
Required if DISCORD_HTML_TRANSCRIPT_API_KEY is set.
(format: Bearer <DISCORD_HTML_TRANSCRIPT_API_KEY>)
Endpoints
Endpoint Description
GET /health Retrieves basic server information.
POST /transcript Accepts a transcript Payload and asynchronously generates an HTML byte stream.
Versioning

The server validates the Server-Version header using the following rules:

  • Pre-release versions must match exactly.
  • Major versions must match exactly.
  • Server minor version must be greater than or equal to Server-Version minor version.

Tip

Request examples can be found here.

Request Payload Example

You can specify the options object inside your payload to configure the generator:

{
  "guild": {},
  "channel": {},
  "messages": [],
  "options": {
    "attachment": {
      // If set to "true", the generator will download referenced attachments and encode them into the file.
      // default: false
      "save_images": true
    },
    "style": {
      // If set, the generator will use the styles of the specified path.
      // default: null
      "path": "path/to/style.css"
    }
  }
}

Contributing

If you found discord-html-transcript useful, please consider giving it a 🌟!

Need help? Ask the Community!

Made With ❤️ By Omar Diaa

Fiverr Ko-fi