Package dev.skywolfxp.transcript
Class Transcript
java.lang.Object
dev.skywolfxp.transcript.Transcript
Represents a generated Transcript in HTML of your Discord
TextChannel.
Uses Java Template Engine for HTML generation.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructsTranscriptwithTemplateEngineprecompiled template configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidrender(net.dv8tion.jda.api.entities.channel.concrete.TextChannel textChannel) net.dv8tion.jda.api.utils.FileUploadtoFileUpload(String fileName) Converts the output toFileUploadto directly send anywhere on Discord.voidwriteToFile(File file) Writes the output to the specifiedFile.
-
Constructor Details
-
Transcript
public Transcript()ConstructsTranscriptwithTemplateEngineprecompiled template configuration.
-
-
Method Details
-
render
public void render(@NotNull net.dv8tion.jda.api.entities.channel.concrete.TextChannel textChannel) throws IllegalArgumentException, gg.jte.TemplateException - Parameters:
textChannel- TheTextChannelfor which to write the Transcript.- Throws:
IllegalArgumentException- If the specifiedtextChannelcontains no messages.gg.jte.TemplateException
-
toFileUpload
Converts the output toFileUploadto directly send anywhere on Discord.The
fileNameis appended with.htmlif it is not suffixed with it.- Parameters:
fileName- The file name to use for the generatedFileUpload.- Returns:
- A
FileUploadof the generated Transcript.
-
writeToFile
Writes the output to the specifiedFile.- Parameters:
file- TheFileto which the transcript should be written.- Throws:
IOException- If an I/O error occurs during file writing.
-