Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug with tag-raw not displaying leading spaces #347

Merged
merged 1 commit into from
Jan 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import org.slf4j.LoggerFactory;
import org.togetherjava.tjbot.commands.SlashCommandAdapter;
import org.togetherjava.tjbot.commands.SlashCommandVisibility;
import org.togetherjava.tjbot.commands.utils.MessageUtils;
import org.togetherjava.tjbot.config.Config;

import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.Objects;
import java.util.OptionalLong;
Expand Down Expand Up @@ -154,14 +154,8 @@ private void rawTag(@NotNull SlashCommandEvent event) {
return;
}

event
.replyEmbeds(new EmbedBuilder()
.setDescription(MessageUtils.escapeMarkdown(tagSystem.getTag(id).orElseThrow()))
.setFooter(event.getUser().getName())
.setTimestamp(Instant.now())
.setColor(TagSystem.AMBIENT_COLOR)
.build())
.queue();
String content = tagSystem.getTag(id).orElseThrow();
event.reply("").addFile(content.getBytes(StandardCharsets.UTF_8), "content.md").queue();
}

private void createTag(@NotNull CommandInteraction event) {
Expand Down