forked from mahtoid/DiscordChatExporterPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f6faed
commit 51d4ad6
Showing
16 changed files
with
329 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...in/java/org/swordofsouls/discord/chatexporter/Html/Builders/Components/ButtonBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.swordofsouls.discord.chatexporter.Html.Builders.Components; | ||
|
||
import org.swordofsouls.discord.chatexporter.Html.Builders.HtmlBase; | ||
import org.swordofsouls.discord.chatexporter.Html.HtmlFile; | ||
|
||
import java.awt.*; | ||
|
||
public class ButtonBuilder extends HtmlBase { | ||
public ButtonBuilder(HtmlFile file) { | ||
super(file); | ||
} | ||
|
||
public void setColor(Color color) { | ||
file.replace("STYLE", String.format("#%02x%02x%02x", color.getRed(), color.getGreen(),color.getBlue())); | ||
} | ||
public void setDisabled(Boolean value) { | ||
if(value) file.replace("DISABLED", "chatlog__component-disabled"); | ||
} | ||
public void setUrl(String url) { | ||
file.replace("URL", url); | ||
} | ||
public void setEmoji(String emoji) { | ||
file.replace("EMOJI", emoji); | ||
} | ||
public void setLabel(String label) { | ||
file.replace("LABEL", label); | ||
} | ||
public void setIcon(String icon) { | ||
file.replace("ICON", icon); | ||
} | ||
|
||
@Override | ||
public HtmlFile build() { | ||
file.replace("DISABLED",""); | ||
file.replace("URL",""); | ||
file.replace("ICON",""); | ||
file.replace("LABEL",""); | ||
file.replace("EMOJI",""); | ||
return getFile(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...n/java/org/swordofsouls/discord/chatexporter/Html/Builders/Message/PinMessageBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.swordofsouls.discord.chatexporter.Html.Builders.Message; | ||
|
||
import org.swordofsouls.discord.chatexporter.Html.Builders.HtmlBase; | ||
import org.swordofsouls.discord.chatexporter.Html.HtmlFile; | ||
import org.swordofsouls.discord.chatexporter.Utils.File.FileUtils; | ||
|
||
import java.time.Instant; | ||
import java.time.ZoneId; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
public class PinMessageBuilder extends HtmlBase { | ||
public PinMessageBuilder(HtmlFile file) { | ||
super(file); | ||
file.replace("PIN_URL", FileUtils.PINNED_MESSAGE_ICON); | ||
} | ||
|
||
@Override | ||
public HtmlFile build() { | ||
return getFile(); | ||
} | ||
|
||
public void setMessageId(Long messageId) { | ||
file.replace("MESSAGE_ID", messageId.toString()); | ||
} | ||
public void setRefMessageId(Long refMessageId) { | ||
file.replace("REF_MESSAGE_ID", refMessageId.toString()); | ||
} | ||
public void setName(String name) { | ||
file.replace("NAME_TAG", name); | ||
file.replace("NAME", name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.