Skip to content

Commit

Permalink
Fix: Minor Typos/Formatting in Hoppity's (hannibal002#2416)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidArthurCole authored Aug 26, 2024
1 parent 46bc783 commit d15d82c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,20 @@ object HoppityEventSummary {
val currentYear = SkyBlockTime.now().year
val statsYearList = statsStorage.keys.takeIf { it.isNotEmpty() } ?: mutableListOf()
val statsYearFormatList = statsStorage.keys.takeIf { it.isNotEmpty() }?.map {
"§b$it${if (it == currentYear) " §a(Current)§r" else ""}"
"§b$it${if (it == currentYear && HoppityAPI.isHoppityEvent()) " §a(Current)§r" else ""}"
}?.toMutableList() ?: mutableListOf()

val parsedInt: Int? = if (it.size == 1) it[0].toIntOrNull() else null

val availableYearsFormat = "§eStats are available for the following years:§af\n${statsYearFormatList.joinToString("§e,") { it }}"
val availableYearsFormat = "§eHoppity Event Stats are available for the following years:§r\n${statsYearFormatList.joinToString("§e, ") { it }}"

if (parsedInt == null) {
if (HoppityAPI.isHoppityEvent()) {
val stats = getYearStats(currentYear).first ?: return
sendStatsMessage(stats, currentYear)
} else ChatUtils.chat(availableYearsFormat)
} else if (!statsYearList.contains(parsedInt)) {
ChatUtils.chat("Could not find stats for year §b$parsedInt§e.\n$availableYearsFormat")
ChatUtils.chat("Could not find data for year §b$parsedInt§e.\n$availableYearsFormat")
} else {
val stats = getYearStats(parsedInt).first ?: return
sendStatsMessage(stats, parsedInt)
Expand Down

0 comments on commit d15d82c

Please sign in to comment.