Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
NoPro200 committed May 6, 2024
1 parent 6d1ebe4 commit 826578c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.nopro200</groupId>
<artifactId>discord-html-transcript-corretto11</artifactId>
<version>1.1-SNAPSHOT</version>
<version>1.2-SNAPSHOT</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
12 changes: 4 additions & 8 deletions src/main/java/de/nopro200/DiscordHtmlTranscripts.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,11 @@ public String saveHtmlFile(TextChannel textChannel, String path) {
textChannel.sendFiles(transcript.createTranscript(textChannel)).queue();

File file = new File(path);
if (file.isDirectory()) {
if (path.toLowerCase().endsWith(".html")) {
FileUtils.writeStringToFile(file, transcript.fileUploadToFileContent(transcript.createTranscript(textChannel)), String.valueOf(StandardCharsets.UTF_8));
return "Success (Saved to \"" + path + "\")";
} else {
return "Err: Invaild File! It should end with .html!";
}
if (path.toLowerCase().endsWith(".html")) {
FileUtils.writeStringToFile(file, transcript.fileUploadToFileContent(transcript.createTranscript(textChannel)), String.valueOf(StandardCharsets.UTF_8));
return "Success (Saved to \"" + path + "\")";
} else {
return "Err: Invaild File Path!";
return "Err: Invaild File! It should end with .html!";
}

} catch (IOException e) {
Expand Down

0 comments on commit 826578c

Please sign in to comment.