Skip to content

Commit

Permalink
Conflict wiki fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed May 27, 2024
1 parent 98915ae commit 97e44b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,14 @@ public String importWikiPage(@Me GuildDB db, ConflictManager manager,
if (conflict.getStartTurn() < TimeUtil.getTurn(1577836800000L)) {
response.append("Conflict `" + name + "` before the war cutoff date of " + DiscordUtil.timestamp(1577836800000L, null) + "\n");
} else {
loadWikiConflicts(db, manager, List.of(conflict), true, true);
Set<Conflict> conflicts = loadWikiConflicts(db, manager, List.of(conflict), true, true);
List<String> conflictNamesAndIds = conflicts.stream().map(f -> f.getName() + " - #" + f.getId()).toList();
response.append("Loaded conflict `" + name + "` with url `https://politicsandwar.com/wiki/" + url + "`\n");
if (conflictNamesAndIds.isEmpty()) {
response.append("No conflicts created\n");
} else {
response.append("Created loaded\n- " + StringMan.join(conflictNamesAndIds, "\n- ") + "\n");
}
response.append("See: " +
CM.conflict.info.cmd.toSlashMention() +
"\n\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ public double getDamageConverted(boolean isPrimary) {
}

public void addAnnouncement(String desc, DBTopic topic, boolean saveToDB) {
announcements.entrySet().removeIf(f -> f.getValue().topic_id == topic.topic_id);
announcements.put(desc, topic);
if (saveToDB) {
getManager().addAnnouncement(id, topic.topic_id, desc);
Expand Down

0 comments on commit 97e44b2

Please sign in to comment.