😊 A easy Transcript Message collector that sends in html format.
npm i discord-ghost-transcript-v13
With Options, you can customize the title, description, date format, date location and the order of messages
Reactions Embeds Downloads Blocks of code File preview for read/write files
Feel free to contribute to this project.
const { fetchTranscript } = require("discord-ghost-transcript-v13");
const { MessageAttachment } = require("discord.js");
//example
const Command = require("../structures/command")
const { fetchTranscript } = require('discord-ghost-transcript-v13');
const Discord = require("discord.js");
module.exports = new Command({
name: "tscript",
description: "Sends a message transcript",
type: "BOTH",
slashCommandOptions: [],
permission: "SEND_MESSAGES",
async run(message){
console.log()
fetchTranscript(message, {
channel: message.channel ,
numberOfMessages: 20 ,
inverseArray: true, // order of messages, default is "false"
dateFormat: "MM/DD/YYYY at HH:mm:ss", // moment date format, default is 'E, d MMM yyyy HH:mm:ss Z'
dateLocale: "pt-br", // moment locale, default is "en"
customTitle: `Channel Name: ${message.channel.name}`, // title, default is your guild name
customDescription: `Channel Description: ${message.channel.topic}`, // description, default is `Transcripted ${numberOfMessages} messages From: ${channel.name}`
}).then((data) => {
const file = new Discord.MessageAttachment(data, `${message.channel.name}.html`);
message.reply({files: [file]});
});
}
});
// it will fetch 5 messages in the current channel with custom options.