Skip to content

Commit 555fed5

Browse files
committed
handle subcommand correctly
1 parent fdb9985 commit 555fed5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/java/vc/listeners/SlashCommandListener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.List;
2121
import java.util.Map;
2222
import java.util.stream.Collectors;
23+
import java.util.stream.Stream;
2324

2425
@Component
2526
public class SlashCommandListener {
@@ -83,6 +84,7 @@ private void logMessage(SlashCommand command, final ChatInputInteractionEvent ev
8384
.map(ApplicationCommandInteraction::getOptions)
8485
.orElse(Collections.emptyList())
8586
.stream()
87+
.flatMap(o -> Stream.concat(Stream.of(o), o.getOptions().stream()))
8688
.map(s -> s.getName() + s.getValue().map(v -> ":" + v.getRaw()).orElse(""))
8789
.collect(Collectors.joining(" "));
8890
String guild = event.getInteraction().getGuildId()

src/main/java/vc/live/LiveChat.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import vc.live.dto.ChatsRecord;
1313
import vc.live.dto.DeathsRecord;
1414

15-
import java.time.Instant;
1615
import java.util.List;
1716
import java.util.concurrent.ScheduledExecutorService;
1817

@@ -71,7 +70,7 @@ private EmbedData getChatEmbed(final ChatsRecord chat) {
7170
.description(escape("**" + chat.playerName() + ":** " + chat.chat()))
7271
.footer("\u200b", avatarUrl(chat.playerUuid()).toString())
7372
.color(chat.chat().startsWith(">") ? Color.MEDIUM_SEA_GREEN : Color.BLACK)
74-
.timestamp(Instant.ofEpochSecond(chat.time().toEpochSecond()))
73+
.timestamp(chat.time().toInstant())
7574
.build()
7675
.asRequest();
7776
}
@@ -85,7 +84,7 @@ private EmbedData getDeathEmbed(final DeathsRecord death) {
8584
.description(escape(death.deathMessage().replace(death.victimPlayerName(), "**" + death.victimPlayerName() + "**")))
8685
.footer("\u200b", avatarUrl(death.victimPlayerUuid()).toString())
8786
.color(Color.RUBY)
88-
.timestamp(Instant.ofEpochSecond(death.time().toEpochSecond()))
87+
.timestamp(death.time().toInstant())
8988
.build()
9089
.asRequest();
9190
}

src/main/java/vc/live/LiveConnections.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import vc.live.dto.ConnectionsRecord;
1313
import vc.live.dto.enums.Connectiontype;
1414

15-
import java.time.Instant;
1615
import java.util.List;
1716
import java.util.concurrent.ScheduledExecutorService;
1817

@@ -70,7 +69,7 @@ protected EmbedData buildConnectionsEmbed(final ConnectionsRecord con) {
7069
.description("**" + escape(con.playerName()) + "** " + (isJoin ? "connected" : "disconnected"))
7170
.footer("\u200b", avatarUrl(con.playerUuid()).toString())
7271
.color(isJoin ? Color.SEA_GREEN : Color.RUBY)
73-
.timestamp(Instant.ofEpochSecond(con.time().toEpochSecond()))
72+
.timestamp(con.time().toInstant())
7473
.build()
7574
.asRequest();
7675
}

0 commit comments

Comments
 (0)