{"id":14983278,"url":"https://github.com/itzderock/discord-html-transcripts","last_synced_at":"2025-05-15T04:02:38.778Z","repository":{"id":39903826,"uuid":"415610579","full_name":"ItzDerock/discord-html-transcripts","owner":"ItzDerock","description":"A node.js library for generating nicely formatted HTML transcripts with discord.js","archived":false,"fork":false,"pushed_at":"2025-02-26T05:48:50.000Z","size":1434,"stargazers_count":232,"open_issues_count":26,"forks_count":94,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T03:10:03.299Z","etag":null,"topics":["discord","discord-transcripts","discordjs","hacktoberfest","markdown","react","react-server-side-rendering"],"latest_commit_sha":null,"homepage":"http://npmjs.org/package/discord-html-transcripts","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ItzDerock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ItzDerock","ko_fi":"derock"}},"created_at":"2021-10-10T14:33:48.000Z","updated_at":"2025-04-12T01:43:32.000Z","dependencies_parsed_at":"2022-08-09T15:36:15.084Z","dependency_job_id":"a1b3d95d-dd76-4380-a1f8-b02dcda22563","html_url":"https://github.com/ItzDerock/discord-html-transcripts","commit_stats":{"total_commits":108,"total_committers":13,"mean_commits":8.307692307692308,"dds":"0.42592592592592593","last_synced_commit":"39c52c4e86ed88d773861368a60ad7be0a95c06a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItzDerock%2Fdiscord-html-transcripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItzDerock%2Fdiscord-html-transcripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItzDerock%2Fdiscord-html-transcripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItzDerock%2Fdiscord-html-transcripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItzDerock","download_url":"https://codeload.github.com/ItzDerock/discord-html-transcripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813796,"owners_count":21165634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","discord-transcripts","discordjs","hacktoberfest","markdown","react","react-server-side-rendering"],"created_at":"2024-09-24T14:07:00.039Z","updated_at":"2025-04-14T03:10:10.951Z","avatar_url":"https://github.com/ItzDerock.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ItzDerock","https://ko-fi.com/derock"],"categories":[],"sub_categories":[],"readme":"# `discord-html-transcripts`\n\n[![Discord](https://img.shields.io/discord/555474311637499955?label=discord)](https://discord.gg/rf5qN7C)\n[![npm](https://img.shields.io/npm/dw/discord-html-transcripts)](http://npmjs.org/package/discord-html-transcripts)\n![GitHub package.json version](https://img.shields.io/github/package-json/v/ItzDerock/discord-html-transcripts)\n![GitHub Repo stars](https://img.shields.io/github/stars/ItzDerock/discord-html-transcripts?style=social)\n\nDiscord 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.\n\nThis module can format the following:\n\n- Discord flavored markdown\n  - Uses [discord-markdown-parser](https://github.com/ItzDerock/discord-markdown-parser)\n  - Allows for complex markdown syntax to be parsed properly\n- Embeds\n- System messages\n  - Join messages\n  - Message Pins\n  - Boost messages\n- Slash commands\n  - Will show the name of the command in the same style as Discord\n- Buttons\n- Reactions\n- Attachments\n  - Images, videos, audio, and generic files\n- Replies\n- Mentions\n- Threads\n\n**This module is designed to work with [discord.js](https://discord.js.org/#/) v14/v15 _only_. If you need v13 support, roll back to v2.X.X**\n\nStyles from [@derockdev/discord-components](https://github.com/ItzDerock/discord-components).  \nBehind the scenes, this package uses React SSR to generate a static site.\n\n## 👋 Support\n\nPlease do not DM me requesting support with this package, I will not respond.  \nInstead, please open a thread on [this](https://discord.gg/MZQN8QMJg8) server.\n\n## 🖨️ Example Output\n\n![output](https://derock.media/r/6G6FIl.gif)\n\n## 📝 Usage\n\n### Example usage using the built in message fetcher.\n\n```js\nconst discordTranscripts = require('discord-html-transcripts');\n// or (if using typescript) import * as discordTranscripts from 'discord-html-transcripts';\n\nconst channel = message.channel; // or however you get your TextChannel\n\n// Must be awaited\nconst attachment = await discordTranscripts.createTranscript(channel);\n\nchannel.send({\n  files: [attachment],\n});\n```\n\n### Or if you prefer, you can pass in your own messages.\n\n```js\nconst discordTranscripts = require('discord-html-transcripts');\n// or (if using typescript) import * as discordTranscripts from 'discord-html-transcripts';\n\nconst messages = someWayToGetMessages(); // Must be Collection\u003cstring, Message\u003e or Message[]\nconst channel = someWayToGetChannel(); // Used for ticket name, guild icon, and guild name\n\n// Must be awaited\nconst attachment = await discordTranscripts.generateFromMessages(messages, channel);\n\nchannel.send({\n  files: [attachment],\n});\n```\n\n## ⚙️ Configuration\n\nBoth methods of generating a transcript allow for an option object as the last parameter.  \n**All configuration options are optional!**\n\n### Built in Message Fetcher\n\n```js\nconst attachment = await discordTranscripts.createTranscript(channel, {\n    limit: -1, // Max amount of messages to fetch. `-1` recursively fetches.\n    returnType: 'attachment', // Valid options: 'buffer' | 'string' | 'attachment' Default: 'attachment' OR use the enum ExportReturnType\n    filename: 'transcript.html', // Only valid with returnType is 'attachment'. Name of attachment.\n    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 !)\n    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\n    callbacks: {\n      // register custom callbacks for the following:\n      resolveChannel: (channelId: string) =\u003e Awaitable\u003cChannel | null\u003e,\n      resolveUser: (userId: string) =\u003e Awaitable\u003cUser | null\u003e,\n      resolveRole: (roleId: string) =\u003e Awaitable\u003cRole | null\u003e\n    },\n    poweredBy: true, // Whether to include the \"Powered by discord-html-transcripts\" footer\n    hydrate: true, // Whether to hydrate the html server-side\n    filter: (message) =\u003e true // Filter messages, e.g. (message) =\u003e !message.author.bot\n});\n```\n\n### Providing your own messages\n\n```js\nconst attachment = await discordTranscripts.generateFromMessages(messages, channel, {\n  // Same as createTranscript, except no limit or filter\n});\n```\n\n## 🤝 Enjoy the package?\n\nGive it a star ⭐ and/or support me on [ko-fi](https://ko-fi.com/derock)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzderock%2Fdiscord-html-transcripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitzderock%2Fdiscord-html-transcripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzderock%2Fdiscord-html-transcripts/lists"}