Class Transcript

java.lang.Object
dev.skywolfxp.transcript.Transcript

public final class Transcript extends Object
Represents a generated Transcript in HTML of your Discord TextChannel.

Uses Java Template Engine for HTML generation.

  • Constructor Details

    • Transcript

      public Transcript()
      Constructs Transcript with TemplateEngine precompiled 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 - The TextChannel for which to write the Transcript.
      Throws:
      IllegalArgumentException - If the specified textChannel contains no messages.
      gg.jte.TemplateException
    • toFileUpload

      @NotNull public net.dv8tion.jda.api.utils.FileUpload toFileUpload(@NotNull String fileName)
      Converts the output to FileUpload to directly send anywhere on Discord.

      The fileName is appended with .html if it is not suffixed with it.

      Parameters:
      fileName - The file name to use for the generated FileUpload.
      Returns:
      A FileUpload of the generated Transcript.
    • writeToFile

      public void writeToFile(@NotNull File file) throws IOException
      Writes the output to the specified File.
      Parameters:
      file - The File to which the transcript should be written.
      Throws:
      IOException - If an I/O error occurs during file writing.