Skip to content

Commit

Permalink
Tweak log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
CominAtYou committed Apr 21, 2024
1 parent 5a82f89 commit a9e42aa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.cominatyou</groupId>
<artifactId>hildabot</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>

<name>hildabot</name>
<url>http://www.example.com</url>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cominatyou/commands/Submit.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void execute(MessageCreateEvent message, List<String> messageArgs) {
.setFooter("Tokens can be used with the /store command.");
message.getChannel().sendMessage(embed);

Log.eventf("Submit", "Successfully accepted submission from %s (%d) in <#%d>. (Submission ID: %d)" , message.getMessageAuthor().getName(), message.getMessageAuthor().getId(), message.getChannel().getId(), message.getMessage().getId());
Log.eventf("Submit", "Successfully processed submission from %s (%d) in <#%d>. (Submission ID: %d)" , message.getMessageAuthor().getName(), message.getMessageAuthor().getId(), message.getChannel().getId(), message.getMessage().getId());

XPSystem.checkForLevelUp(currentLevel, message.getMessageAuthor().asUser().get(), message.getServer().get());
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/cominatyou/util/versioning/Version.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.cominatyou.util.versioning;

public class Version {
public static final String VERSION = "2.5.2";
public static final String BUILD_NUMBER = "11F043";
public static final String VERSION = "2.5.3";
public static final String BUILD_NUMBER = "11F044";
public static final String VERSION_STRING = String.format("%s (%s)", VERSION, BUILD_NUMBER);
}
10 changes: 5 additions & 5 deletions src/main/java/com/cominatyou/xp/XPSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,23 @@ public static void checkForLevelUp(int beforeActionLevel, User user, Server serv
.setDescription("To disable this message going forward, run `h!levelalert` in this DM or <#495034452422950915>.");
try {
user.openPrivateChannel().join().sendMessage(embed);
Log.eventf("LevelAlert", "Sent level up message to %s (%d)", user.getName(), user.getId());
Log.eventf("LevelAlert", "Sent level up message to %s", user.getName());
}
catch (Exception e) {
if (e.getMessage().contains("Cannot send messages to this user")) {
Log.eventf("LevelAlert", "No message was sent to %s (%d) as their privacy settings prevent it.", user.getName(), user.getId());
if (e.getMessage().contains("Cannot send messages to this user")) { // Target user has DMs off for the server
Log.eventf("LevelAlert", "No message was sent to %s as their privacy settings prevent it.", user.getName());
}
else {
e.printStackTrace();
final StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));

Log.error("LevelAlert", String.format("Failed to send level up message to %s (%d)", user.getName(), user.getId()), sw.toString());
Log.error("LevelAlert", String.format("Failed to send level up message to %s.", user.getName()), sw.toString());
}
}
}
else {
Log.eventf("LevelAlert", "Not sending a message to %s (%d) as they have level alerts off.", user.getName(), user.getId());
Log.eventf("LevelAlert", "Not sending a message to %s as they have level alerts off.", user.getName());
}

if (RankUtil.isLevelRankLevel(currentLevel)) {
Expand Down

0 comments on commit a9e42aa

Please sign in to comment.