Skip to content

Commit

Permalink
Target Java 17 & fix some message update logging errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Vauff committed Oct 26, 2021
1 parent e862fd0 commit 743b452
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>1.11</release>
<release>1.17</release>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -67,5 +67,5 @@
<version>4.3.3</version>
</dependency>
</dependencies>
<version>r40</version>
<version>r41</version>
</project>
16 changes: 15 additions & 1 deletion src/com/vauff/maunzdiscord/core/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,21 @@ public static void onMessageUpdate(MessageUpdateEvent event)
try
{
if (event.getMessage().block().getAuthor().isPresent() && event.getOld().isPresent() && event.getOld().get().getFlags().contains(Message.Flag.LOADING))
logMessage(event.getMessage().block());
{
Message msg;

try
{
msg = event.getMessage().block();
}
catch (Exception e)
{
// Message is not available to us, unsure why this is so frequent on this event
return;
}

logMessage(msg);
}
}
catch (Exception e)
{
Expand Down
2 changes: 1 addition & 1 deletion src/com/vauff/maunzdiscord/core/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Main
{
public static GatewayDiscordClient gateway;
public static MongoDatabase mongoDatabase;
public static String version = "r40";
public static String version = "r41";
public static String prefix;

/**
Expand Down

0 comments on commit 743b452

Please sign in to comment.