
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
web-discord-transcripts
Advanced tools
web-discord-transcripts is an npm package that provides a convenient solution for creating web transcripts of chat conversations, particularly for Discord bots, with a focus on ticket systems. This package streamlines the process of generating chat logs and enables easy integration with web applications or user interfaces. It creates static html webpage which can be used to display the transcripts.
You can install web-discord-transcripts using npm or yarn:
npm install web-discord-transcripts
# or
yarn add web-discord-transcripts
To use web-discord-transcripts in your Discord bot or web application, follow the steps below:
Generate the static webpage:
import { Webpage, Message } from "web-discord-transcripts"
import { channels } from "../constants/channel.js"
import { guilds } from "../constants/guild.js"
import data from "../transcripts/example.js"
const nodes = data.map((data) => {
const node = Message({
user: data.user,
payload: { content: data.content, embeds: data.embeds },
time: new Date()
})
return node
})
const page = Webpage({
title: "ticket-transcript",
content: nodes,
data: {
guild: guilds.nightfangCommunity,
chatChannel: channels.ticketTranscripts
}
})
For example, you can use express to show the generated webpage on the browser. Feel free to customize the above steps according to your application's specific needs. This package aims to simplify the process of managing and displaying chat transcripts for discord conversations, especially useful for ticket system.
index.js:
import express from "express"
import transcriptRouter from "./routes/transcript.js"
const app = express()
const port = 3000
app.get("/", (_req, res) => {
res.send("api (/) endpoint")
})
app.use("/transcripts", transcriptRouter)
app.listen(port, () => {
console.log(`server started at port: ${port}`)
})
constants/channel.js:
import { Channel } from "web-discord-transcripts"
export const channels = {
ticketTranscripts: new Channel({ name: "ticket-transcripts" }),
modApplication: new Channel({ name: "📄 mod-application" })
}
constants/guild.js:
import { Guild } from "web-discord-transcripts"
export const guilds = {
nightfangCommunity: new Guild({
name: "Nightfang Community",
iconURL: "https://cdn.discordapp.com/icons/960453487743881237/aaa40a37a4fa84580aa317e7de696d24.webp"
})
}
constants/role.js:
import { Role } from "web-discord-transcripts"
export const roles = {
staff: new Role({ name: "Staff", color: "#5865f2" }),
bot: new Role({ name: "Bot", color: "#f87248" }),
support: new Role({ name: "Support", color: "#ffff00" }),
member: new Role({ name: "Member", color: "#ffffff" }),
}
constants/user.js:
import { User } from "web-discord-transcripts"
import { roles } from "./role.js"
export const users = {
nightfang: new User({
username: "Nightfang",
avatarURL: "https://cdn.discordapp.com/avatars/984245658905104384/a90a3ad0359ff2f67e65b40a13e2cb0d.png?size=1024",
bot: true,
highestRole: roles.bot
}),
shadow: new User({
username: "Shadow",
avatarURL: "https://cdn.discordapp.com/avatars/893705256368750592/957bb7cf2f720432d818c9257a610b8c.png?size=1024",
highestRole: roles.staff
}),
john: new User({
username: "John",
highestRole: roles.support
}),
joe: new User({
username: "Joe",
highestRole: roles.member
})
}
transcripts/example.js:
import { Embed } from "web-discord-transcripts"
import { channels } from "../constants/channel.js"
import { users } from "../constants/user.js"
import { roles } from "../constants/role.js"
const welcomeEmbed = new Embed({
color: "#12c4ff",
title: "Welcome Joe",
description: `Please wait patiently for the ${roles.staff.mention()} to respond, until then do tell the purpose of creating the ticket`
})
const closeEmbed = new Embed({
color: "#f87248",
description: `Ticket closed by ${users.john.mention()}`
})
const data = [
{
user: users.nightfang,
embeds: [welcomeEmbed]
},
{
user: users.joe,
content: [
"Hello",
`${roles.staff.mention()} I want to apply for ${roles.support.mention()} role`
]
},
{
user: users.shadow,
content: [
`${users.john.mention()} will handle this ticket, I'm busy right now`
]
},
{
user: users.john,
content: [
"Hi!",
`${users.joe.mention()} please apply for the support role at ${channels.modApplication.mention()}`,
`You can ping me if you want to ask anything`
]
},
{
user: users.joe,
content: [
"Okay, thanks for the support!",
"You may close the ticket"
]
},
{
user: users.nightfang,
embeds: [closeEmbed]
},
{
user: users.nightfang,
content: [
"This ticket will be deleted in a few seconds"
]
}
]
export default data
routes/transcript.js:
import { Webpage, Message } from "web-discord-transcripts"
import { channels } from "../constants/channel.js"
import { guilds } from "../constants/guild.js"
import data from "../transcripts/example.js"
import { Router } from "express"
const router = Router()
router.get("/example", (_req, res) => {
const nodes = data.map((data) => {
const node = Message({
user: data.user,
payload: { content: data.content, embeds: data.embeds },
time: new Date()
})
return node
})
const page = Webpage({
title: "ticket-transcript",
content: nodes,
data: {
guild: guilds.nightfangCommunity,
chatChannel: channels.ticketTranscripts
}
})
res.status(200).send(page)
})
export default router
Contributions are welcome! If you find any issues or want to suggest enhancements, please open an issue or submit a pull request on the GitHub repository. Always ensure to check if an issue or pull request already exists before creating your own! There’s no need to hurry in making contributions, take your time to do it right.
For support and assistance, join our Discord server and connect with the community to resolve any issues or queries related to the package.
web-discord-transcripts is licensed under the MIT License. See the LICENSE file for more information.
FAQs
Build web discord transcripts easily
The npm package web-discord-transcripts receives a total of 0 weekly downloads. As such, web-discord-transcripts popularity was classified as not popular.
We found that web-discord-transcripts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.