{"_id":"@aquacustoms/discord-html-transcripts","name":"@aquacustoms/discord-html-transcripts","dist-tags":{"latest":"3.2.1"},"versions":{"3.2.1":{"name":"@aquacustoms/discord-html-transcripts","version":"3.2.1","description":"A nicely formatted html transcript generator for discord.js.","main":"dist/index.js","homepage":"https://github.com/aquacustoms/discord-html-transcripts","types":"./dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc -p tsconfig.json","prepack":"npm run build","test:typescript":"ts-node ./tests/generate.ts","lint":"prettier --write --cache . && eslint --cache --fix .","typecheck":"tsc -p tsconfig.eslint.json"},"repository":{"type":"git","url":"git+https://github.com/aquacustoms/discord-html-transcripts.git"},"keywords":["discord.js","discord.js-transcripts","discord.js-html-transcripts","html-transcripts","discord-html-transcripts","discord-transcripts"],"license":"UNLICENSED","devDependencies":{"@types/debug":"^4.1.12","@types/node":"^20.11.17","@types/react":"^18.2.47","@types/react-dom":"^18.2.18","@typescript-eslint/eslint-plugin":"^5.62.0","@typescript-eslint/parser":"^5.62.0","debug":"^4.3.4","discord.js":"^14.14.1","dotenv":"^16.3.1","eslint":"^8.56.0","husky":"^8.0.3","prettier":"^2.8.8","pretty-quick":"^3.1.3","sharp":"^0.33.2","ts-node":"^10.9.2","typescript":"^5.3.3"},"dependencies":{"@derockdev/discord-components-core":"^3.6.1","@derockdev/discord-components-react":"^3.6.1","discord-markdown-parser":"~1.1.0","react":"0.0.0-experimental-6639ed3b3-20240111","react-dom":"0.0.0-experimental-6639ed3b3-20240111","simple-markdown":"^0.7.3","twemoji":"^14.0.2","undici":"^5.28.2"},"peerDependencies":{"discord.js":"^14.0.0 || ^15.0.0"},"overrides":{"react":"$react"},"directories":{"doc":"docs","test":"tests"},"bugs":{"url":"https://github.com/aquacustoms/discord-html-transcripts/issues"},"_id":"@aquacustoms/discord-html-transcripts@3.2.1","gitHead":"583082e31b64f02de264f54288a8e286595e7a11","_nodeVersion":"23.6.0","_npmVersion":"11.0.0","dist":{"integrity":"sha512-MiOt+SCz8Pphd0dmiemWT94IJkNhmaqNDGhaHoZB4VHFKJvjofMyf+hFVTGonnj2wyPQF+5DFhGbUSectuiFMg==","shasum":"55e5dd7e857903ac6c8f0c4819d0711de2f18273","tarball":"https://registry.npmjs.org/@aquacustoms/discord-html-transcripts/-/discord-html-transcripts-3.2.1.tgz","fileCount":54,"unpackedSize":129896,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGcmyaKmg95TCLbSnE2RIcSR7z9WWNy8f0xeUOlfXDrWAiEAlSxEVJ3m1LcJUrTFoMMqh+6aRaIMt/mAseLWbaxRNvE="}]},"_npmUser":{"name":"aquacustoms","email":"aquacustomsmanagement@proton.me"},"maintainers":[{"name":"aquacustoms","email":"aquacustomsmanagement@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/discord-html-transcripts_3.2.1_1741947465340_0.25597189524763264"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-14T10:17:45.268Z","3.2.1":"2025-03-14T10:17:45.569Z","modified":"2025-03-14T10:17:45.801Z"},"maintainers":[{"name":"aquacustoms","email":"aquacustomsmanagement@proton.me"}],"description":"A nicely formatted html transcript generator for discord.js.","homepage":"https://github.com/aquacustoms/discord-html-transcripts","keywords":["discord.js","discord.js-transcripts","discord.js-html-transcripts","html-transcripts","discord-html-transcripts","discord-transcripts"],"repository":{"type":"git","url":"git+https://github.com/aquacustoms/discord-html-transcripts.git"},"bugs":{"url":"https://github.com/aquacustoms/discord-html-transcripts/issues"},"license":"UNLICENSED","readme":"# `discord-html-transcripts`\r\n\r\n[![Discord](https://img.shields.io/discord/555474311637499955?label=discord)](https://discord.gg/rf5qN7C)\r\n[![npm](https://img.shields.io/npm/dw/discord-html-transcripts)](http://npmjs.org/package/discord-html-transcripts)\r\n![GitHub package.json version](https://img.shields.io/github/package-json/v/ItzDerock/discord-html-transcripts)\r\n![GitHub Repo stars](https://img.shields.io/github/stars/ItzDerock/discord-html-transcripts?style=social)\r\n\r\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.\r\n\r\nThis module can format the following:\r\n\r\n- Discord flavored markdown\r\n  - Uses [discord-markdown-parser](https://github.com/ItzDerock/discord-markdown-parser)\r\n  - Allows for complex markdown syntax to be parsed properly\r\n- Embeds\r\n- System messages\r\n  - Join messages\r\n  - Message Pins\r\n  - Boost messages\r\n- Slash commands\r\n  - Will show the name of the command in the same style as Discord\r\n- Buttons\r\n- Reactions\r\n- Attachments\r\n  - Images, videos, audio, and generic files\r\n- Replies\r\n- Mentions\r\n- Threads\r\n\r\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**\r\n\r\nStyles from [@derockdev/discord-components](https://github.com/ItzDerock/discord-components).  \r\nBehind the scenes, this package uses React SSR to generate a static site.\r\n\r\n## 👋 Support\r\n\r\nPlease do not DM me requesting support with this package, I will not respond.  \r\nInstead, please open a thread on [this](https://discord.gg/MZQN8QMJg8) server.\r\n\r\n## 🖨️ Example Output\r\n\r\n![output](https://derock.media/r/6G6FIl.gif)\r\n\r\n## 📝 Usage\r\n\r\n### Example usage using the built in message fetcher.\r\n\r\n```js\r\nconst discordTranscripts = require('discord-html-transcripts');\r\n// or (if using typescript) import * as discordTranscripts from 'discord-html-transcripts';\r\n\r\nconst channel = message.channel; // or however you get your TextChannel\r\n\r\n// Must be awaited\r\nconst attachment = await discordTranscripts.createTranscript(channel);\r\n\r\nchannel.send({\r\n  files: [attachment],\r\n});\r\n```\r\n\r\n### Or if you prefer, you can pass in your own messages.\r\n\r\n```js\r\nconst discordTranscripts = require('discord-html-transcripts');\r\n// or (if using typescript) import * as discordTranscripts from 'discord-html-transcripts';\r\n\r\nconst messages = someWayToGetMessages(); // Must be Collection<string, Message> or Message[]\r\nconst channel = someWayToGetChannel(); // Used for ticket name, guild icon, and guild name\r\n\r\n// Must be awaited\r\nconst attachment = await discordTranscripts.generateFromMessages(messages, channel);\r\n\r\nchannel.send({\r\n  files: [attachment],\r\n});\r\n```\r\n\r\n## ⚙️ Configuration\r\n\r\nBoth methods of generating a transcript allow for an option object as the last parameter.  \r\n**All configuration options are optional!**\r\n\r\n### Built in Message Fetcher\r\n\r\n```js\r\nconst attachment = await discordTranscripts.createTranscript(channel, {\r\n    limit: -1, // Max amount of messages to fetch. `-1` recursively fetches.\r\n    returnType: 'attachment', // Valid options: 'buffer' | 'string' | 'attachment' Default: 'attachment' OR use the enum ExportReturnType\r\n    filename: 'transcript.html', // Only valid with returnType is 'attachment'. Name of attachment.\r\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 !)\r\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\r\n    callbacks: {\r\n      // register custom callbacks for the following:\r\n      resolveChannel: (channelId: string) => Awaitable<Channel | null>,\r\n      resolveUser: (userId: string) => Awaitable<User | null>,\r\n      resolveRole: (roleId: string) => Awaitable<Role | null>\r\n    },\r\n    poweredBy: true, // Whether to include the \"Powered by discord-html-transcripts\" footer\r\n    hydrate: true, // Whether to hydrate the html server-side\r\n    filter: (message) => true // Filter messages, e.g. (message) => !message.author.bot\r\n});\r\n```\r\n\r\n### Providing your own messages\r\n\r\n```js\r\nconst attachment = await discordTranscripts.generateFromMessages(messages, channel, {\r\n  // Same as createTranscript, except no limit or filter\r\n});\r\n```\r\n\r\n## 🤝 Enjoy the package?\r\n\r\nGive it a star ⭐ and/or support me on [ko-fi](https://ko-fi.com/derock)\r\n","readmeFilename":"README.md","_rev":"1-11c117ce5a8d8f82698dd6b59d12b00f"}