2.0.2 • Published 2 years ago
transcript-messages v2.0.2
About
transcript-messages
allows you to easily transcript and import transcripts of Discord Channels (specialized in tickets).
Installation
Discord.js v13 or above is needed.
npm install transcript-messages
yarn add transcript-messages
pnpm add transcript-messages
How to use
It's easy to use:
index.js
require(`transcript-messages`)(require); // Must be started before `Discord.js`.
const Discord = require(`discord.js`);
const client = new Discord.Client(...);
// ...
client.transcripts = new Discord.Collection(); // Make a temporary collection to save transcripts, you probably would want to use a DB instead
transcript.js
const json = await interaction.channel.transcript(); // Remember, it's an async function!
interaction.client.transcripts.set(interaction.guild.id, json);
loadTranscript.js
const webhook = interaction.channel.createWebhook(...);
await interaction.channel.importTranscript(
interaction.client.transcripts.get(interaction.guild.id),
webhook // ...or you can leave this alone and it will generate it but it will not handle errors
);