createTranscript
Example
const discordTranscripts = require("discord-html-transcripts");
[...]
// Notice the async here ⤵️
client.on('messageCreate', async (message) => {
if (message.content === "!transcript") {
// Use the following to fetch the transcript.
const transcript = await discordTranscripts.createTranscript(
message.channel,
{
// options go here
// for example
saveImages: true,
footerText: "Saved {number} message{s}"
}
);
// and by default, createTranscript will return an AttachmentBuilder
// which you can directly send to discord.js
message.reply({
content: "Here's your transcript!",
files: [transcript]
});
}
});Parameters
channel: TextBasedChannel
channel: TextBasedChanneloptions: CreateTranscriptOptions
options: CreateTranscriptOptionsoptions.limit: number
options.limit: numberoptions.filter: (message: Message<boolean>) => boolean
options.filter: (message: Message<boolean>) => booleanLast updated