Discord HTML Transcripts is a node.js module (recode on JDA) to generate nice looking HTML transcripts. Processes discord markdown like bold, italics, strikethroughs, and more. Nicely formats attachments and embeds. Built in XSS protection, preventing users from inserting html tags.
This module is designed to work with JDA.
HTML Template stolen from DiscordChatExporter and this is a Fork from Ryzeon/discord-html-transcripts with the difference that it's compiled for the corretto11 Version and an older Version of JDA (5.0.0-alpha.20).
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.NoPro200</groupId>
<artifactId>discord-html-transcript-corretto11-jda</artifactId>
<version>TAG</version>
</dependency>
DiscordHtmlTranscripts transcript = DiscordHtmlTranscripts.getInstance();
textChannel.sendFiles(transcript.createTranscript(textChannel)).queue()
DiscordHtmlTranscripts transcript = DiscordHtmlTranscripts.getInstance();
transcript.generateFromMessages(messages); // return to InputStream
DiscordHtmlTranscripts transcripts = new DiscordHtmlTranscripts().getInstance();
try {
testChannel.sendFiles(transcripts.getTranscript(testChannel, "test.html")).queue();
} catch (IOException e) {
throw new RuntimeException(e);
}
DiscordHtmlTranscripts transcripts = new DiscordHtmlTranscripts().getInstance();
try {
transcripts.saveHtmlFile(textchannel, "test.html");
} catch (IOException e) {
throw new RuntimeException(e);
}
It also returns the FileUpload so you can easely can send it
DiscordHtmlTranscripts transcripts = new DiscordHtmlTranscripts().getInstance();
try {
FileUpload testFile = transcripts.saveHtmlFile(textchannel, "test.html");
textchannel.sendFiles(testFile).queue();
} catch (IOException e) {
throw new RuntimeException(e);
}
DiscordHtmlTranscripts transcripts = new DiscordHtmlTranscripts().getInstance();
try {
FileUpload testFile = testChannel.saveHtmlFile(textchannel, "test.html");
String htmlString = transcripts.fileUploadToFileContent(testFile);
} catch (IOException e) {
throw new RuntimeException(e);
}
Discord HTML Transcripts ist ein node.js-Modul (recode on JDA), um schön aussehende HTML-Transkripte zu erzeugen. Verarbeitet Discord Markdown wie fett, Kursivschrift, Durchstreichen und mehr. Schöne Formatierung von Anhängen und Einbettungen. Eingebauter XSS-Schutz, der verhindert, dass Benutzer HTML-Tags einfügen.
Dieses Modul ist für die Arbeit mit JDA konzipiert.
HTML-Vorlage gestohlen von DiscordChatExporter und dies ist ein Fork von Ryzeon/discord-html-transcripts mit dem Unterschied, dass es für die corretto11 Version und eine ältere Version von JDA (5.0.0-alpha.20) kompiliert wurde.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.NoPro200</groupId>
<artifactId>discord-html-transcript-corretto11-jda</artifactId>
<version>TAG</version>
</dependency>
DiscordHtmlTranscripts transcript = DiscordHtmlTranscripts.getInstance();
textChannel.sendFiles(transcript.createTranscript(textChannel)).queue()
DiscordHtmlTranscripts transcript = DiscordHtmlTranscripts.getInstance();
transcript.generateFromMessages(messages); // return to InputStream
DiscordHtmlTranscripts transcripts = new DiscordHtmlTranscripts().getInstance();
try {
testChannel.sendFiles(transcripts.getTranscript(testChannel, "test.html")).queue();
} catch (IOException e) {
throw new RuntimeException(e);
}
DiscordHtmlTranscripts transcripts = new DiscordHtmlTranscripts().getInstance();
try {
transcripts.saveHtmlFile(textchannel, "test.html");
} catch (IOException e) {
throw new RuntimeException(e);
}
Es gibt auch den FileUpload zurück, so dass Sie es einfach senden können
DiscordHtmlTranscripts transcripts = new DiscordHtmlTranscripts().getInstance();
try {
FileUpload testFile = transcripts.saveHtmlFile(textchannel, "test.html");
textchannel.sendFiles(testFile).queue();
} catch (IOException e) {
throw new RuntimeException(e);
}
DiscordHtmlTranscripts transcripts = new DiscordHtmlTranscripts().getInstance();
try {
FileUpload testFile = testChannel.saveHtmlFile(textchannel, "test.html");
String htmlString = transcripts.fileUploadToFileContent(testFile);
} catch (IOException e) {
throw new RuntimeException(e);
}