1717import vc .util .PlayerLookup ;
1818
1919import javax .annotation .Nullable ;
20+ import java .net .http .HttpTimeoutException ;
2021import java .time .OffsetDateTime ;
2122import java .util .UUID ;
2223
@@ -54,11 +55,21 @@ private Mono<Message> resolveSeen(final ChatInputInteractionEvent event, final P
5455 try {
5556 seenResponse = seenApi .seen (uuid , null );
5657 } catch (final Exception e ) {
57- if (e instanceof ApiException apiException
58- && (apiException .getCause () instanceof MismatchedInputException || apiException .getCode () == 204 )) {
59- // fall through
58+ if (e instanceof ApiException apiException ) {
59+ if (apiException .getCause () instanceof MismatchedInputException || apiException .getCode () == 204 ) {
60+ return event .createFollowup ()
61+ .withEmbeds (populateIdentity (EmbedCreateSpec .builder (), identity )
62+ .color (Color .RUBY )
63+ .description ("Never Seen" )
64+ .thumbnail (identity .getAvatarURL ())
65+ .build ());
66+ } else if (apiException .getCause () instanceof HttpTimeoutException httpTimeoutException ) {
67+ LOGGER .error ("Timeout getting seen for: {}" , identity .uuid (), httpTimeoutException );
68+ return error (event , "Timeout getting seen data. Try again in a minute" );
69+ }
6070 } else {
6171 LOGGER .error ("Failed to get seen for player: {}" , uuid , e );
72+ throw new RuntimeException (e );
6273 }
6374 }
6475 if (isNull (seenResponse ))
@@ -70,11 +81,11 @@ private Mono<Message> resolveSeen(final ChatInputInteractionEvent event, final P
7081 .build ());
7182 return event .createFollowup ()
7283 .withEmbeds (populateIdentity (EmbedCreateSpec .builder ()
73- .addField ("First seen" , getSeenString (seenResponse .getFirstSeen ()), false )
74- .addField ("Last seen" , getSeenString (seenResponse .getLastSeen ()), false ), identity )
75- .color (Color .CYAN )
76- .thumbnail (identity .getAvatarURL ())
77- .build ());
84+ .addField ("First seen" , getSeenString (seenResponse .getFirstSeen ()), false )
85+ .addField ("Last seen" , getSeenString (seenResponse .getLastSeen ()), false ), identity )
86+ .color (Color .CYAN )
87+ .thumbnail (identity .getAvatarURL ())
88+ .build ());
7889 }
7990
8091 private String getSeenString (@ Nullable final OffsetDateTime seen ) {
0 commit comments