Skip to content
Merged
Show file tree
Hide file tree
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 @@ -14,6 +14,8 @@

import org.jetbrains.annotations.NotNull;

import java.time.Instant;

/**
* Subcommand that lets staff members accept suggestions.
*/
Expand Down Expand Up @@ -46,7 +48,7 @@ protected WebhookMessageCreateAction<Message> handleSuggestionCommand(@NotNull S
.setAuthor(embed.getAuthor().getName(), embed.getAuthor().getUrl(), embed.getAuthor().getIconUrl())
.setTitle("Suggestion Accepted")
.setDescription(embed.getDescription())
.setTimestamp(embed.getTimestamp())
.setTimestamp(Instant.now())
.setFooter("Accepted by " + UserUtils.getUserTag(user))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ClearSuggestionSubcommand(BotConfig botConfig) {
@Override
protected WebhookMessageCreateAction<Message> handleSuggestionCommand(@NotNull SlashCommandInteractionEvent event, @NotNull Message message) {
MessageEmbed embed = message.getEmbeds().get(0);
MessageEmbed clearEmbed = buildSuggestionClearEmbed(embed);
MessageEmbed clearEmbed = buildSuggestionClearEmbed(message, embed);
SystemsConfig.EmojiConfig emojiConfig = botConfig.getSystems().getEmojiConfig();
message.editMessageEmbeds(clearEmbed).queue(
edit -> {
Expand All @@ -43,13 +43,13 @@ protected WebhookMessageCreateAction<Message> handleSuggestionCommand(@NotNull S
.setComponents(getJumpButton(message));
}

private @NotNull MessageEmbed buildSuggestionClearEmbed(@NotNull MessageEmbed embed) {
private @NotNull MessageEmbed buildSuggestionClearEmbed(@NotNull Message message, @NotNull MessageEmbed embed) {
return new EmbedBuilder()
.setColor(Responses.Type.DEFAULT.getColor())
.setAuthor(embed.getAuthor().getName(), embed.getAuthor().getUrl(), embed.getAuthor().getIconUrl())
.setTitle("Suggestion")
.setDescription(embed.getDescription())
.setTimestamp(embed.getTimestamp())
.setTimestamp(message.getTimeCreated())
.setFooter(null)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

import org.jetbrains.annotations.NotNull;

import java.time.Instant;

/**
* <h3>This class represents the /suggestion decline command.</h3>
*/
Expand Down Expand Up @@ -48,7 +50,7 @@ protected WebhookMessageCreateAction<Message> handleSuggestionCommand(@NotNull S
.setAuthor(embed.getAuthor().getName(), embed.getAuthor().getUrl(), embed.getAuthor().getIconUrl())
.setTitle("Suggestion Declined")
.setDescription(embed.getDescription())
.setTimestamp(embed.getTimestamp())
.setTimestamp(Instant.now())
.setFooter("Declined by " + UserUtils.getUserTag(user));
if (reason != null) builder.addField("Reason", reason, false);
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import org.jetbrains.annotations.NotNull;

import java.time.Instant;

/**
* <h3>This class represents the /suggestion on-hold command.</h3>
*/
Expand Down Expand Up @@ -47,7 +49,7 @@ protected WebhookMessageCreateAction<Message> handleSuggestionCommand(@NotNull S
.setAuthor(embed.getAuthor().getName(), embed.getAuthor().getUrl(), embed.getAuthor().getIconUrl())
.setTitle("Suggestion On Hold")
.setDescription(embed.getDescription())
.setTimestamp(embed.getTimestamp())
.setTimestamp(Instant.now())
.setFooter("Suggestion marked as On Hold by " + UserUtils.getUserTag(user))
.build();
}
Expand Down
Loading