Skip to content

Commit 12044b8

Browse files
committed
Using attachment for tag-raw
instead of escaped markdown in an embed which leads to bugs
1 parent e041e4e commit 12044b8

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

application/src/main/java/org/togetherjava/tjbot/commands/tags/TagManageCommand.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
import org.slf4j.LoggerFactory;
1616
import org.togetherjava.tjbot.commands.SlashCommandAdapter;
1717
import org.togetherjava.tjbot.commands.SlashCommandVisibility;
18-
import org.togetherjava.tjbot.commands.utils.MessageUtils;
1918
import org.togetherjava.tjbot.config.Config;
2019

20+
import java.nio.charset.StandardCharsets;
2121
import java.time.Instant;
2222
import java.util.Objects;
2323
import java.util.OptionalLong;
@@ -154,14 +154,8 @@ private void rawTag(@NotNull SlashCommandEvent event) {
154154
return;
155155
}
156156

157-
event
158-
.replyEmbeds(new EmbedBuilder()
159-
.setDescription(MessageUtils.escapeMarkdown(tagSystem.getTag(id).orElseThrow()))
160-
.setFooter(event.getUser().getName())
161-
.setTimestamp(Instant.now())
162-
.setColor(TagSystem.AMBIENT_COLOR)
163-
.build())
164-
.queue();
157+
String content = tagSystem.getTag(id).orElseThrow();
158+
event.reply("").addFile(content.getBytes(StandardCharsets.UTF_8), "content.md").queue();
165159
}
166160

167161
private void createTag(@NotNull CommandInteraction event) {

0 commit comments

Comments
 (0)