3.6.4 • Published 3 years ago

discord-transcripts v3.6.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Discord.js Transcripts

Discord Transcripts is a node.js module to generate nice looking HTML transcripts.

Usage

Example usage using the built in message fetcher.

const discordTranscripts = require('discord-transcripts');
// or (if using typescript) import * as discordTranscripts from 'discord-transcripts';

const channel = message.channel; // or however you get your TextChannel

// Must be awaited
const attachment = await discordTranscripts.createTranscript(channel);

channel.send({
    files: [attachment]
});

Or if you prefer, you can pass in your own messages.

const discordTranscripts = require('discord-transcripts');
// or (if using typescript) import * as discordTranscripts from 'discord-transcripts';

const messages = someWayToGetMessages(); // Must be Collection<string, Message> or Message[]
const channel  = someWayToGetChannel();  // Used for ticket name, guild icon, and guild name

// You do not need to await this
const attachment = discordTranscripts.generateFromMessages(messages, channel);

channel.send({
    files: [attachment]
});

Configuration

Both methods of generating a transcript allow for an option object as the last parameter.

Built in Message Fetcher

const attachment = await createTranscript(channel, {
    limit: -1, // Max amount of messages to fetch.
    returnBuffer: false, // Return a buffer instead of a MessageAttachment 
    fileName: 'transcript.html' // Only valid with returnBuffer false. Name of attachment. 
});

Providing your own messages

const attachment = await generateFromMessages(messages, channel, {
    returnBuffer: false, // Return a buffer instead of a MessageAttachment 
    fileName: 'transcript.html' // Only valid with returnBuffer false. Name of attachment. 
});
3.6.2

3 years ago

3.6.4

3 years ago

3.6.3

3 years ago

2.2.5

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.1.3

3 years ago