Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object PetAPI {
private val PET_NAME_REGEX by Regex("^(?<favorite>⭐ )?\\[Lvl (?<level>\\d+)] (?:\\[\\d+✦] )?(?<name>[A-z- ]+)(?: ✦|\$)").fromRepo("pets.name")

// TODO cache autopet rule pets to allow for getting complete data
private val AUTOPET_REGEX by Regex(
val AUTOPET_REGEX by Regex(
"^§cAutopet §eequipped your §7\\[Lvl (?<level>\\d+)] (?:§.\\[.*] )?§(?<rarity>.)(?<name>[A-z ]+)(?:§. ✦)?§e! §a§lVIEW RULE"
).fromRepo("pets.autopet")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ object ChatCategory {
descriptionText = tr("nobaaddons.config.chat.filters.hideProfileInfo.tooltip", "Hides messages showing the active profile and profile ID")
booleanController()
}
add({ chat.filters::hideAutopetMessages }) {
name = tr("nobaaddons.config.chat.filters.hideAutopetMessages", "Hide Autopet Messages")
booleanController()
}
// endregion
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ChatConfig {

var hideProfileInfo = false
var hideTipMessages = false
var hideAutopetMessages = false
}

class ChatCommands {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import me.nobaboy.nobaaddons.features.chat.filters.ability.AbilityChatFilter
import me.nobaboy.nobaaddons.features.chat.filters.dungeons.BlessingChatFilter
import me.nobaboy.nobaaddons.features.chat.filters.dungeons.HealerOrbChatFilter
import me.nobaboy.nobaaddons.features.chat.filters.dungeons.PickupObtainChatFilter
import me.nobaboy.nobaaddons.features.chat.filters.miscellaneous.AutoPetChatFilter
import me.nobaboy.nobaaddons.features.chat.filters.miscellaneous.ProfileInfoChatFilter
import me.nobaboy.nobaaddons.features.chat.filters.miscellaneous.TipMessagesChatFilter
import me.nobaboy.nobaaddons.features.chat.filters.mobs.SeaCreatureCatchMessageChatFilter
Expand Down Expand Up @@ -34,6 +35,7 @@ interface IChatFilter {
HealerOrbChatFilter,
PickupObtainChatFilter,
// Miscellaneous
AutoPetChatFilter,
ProfileInfoChatFilter,
TipMessagesChatFilter,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package me.nobaboy.nobaaddons.features.chat.filters.miscellaneous

import me.nobaboy.nobaaddons.api.skyblock.PetAPI
import me.nobaboy.nobaaddons.features.chat.filters.IChatFilter

object AutoPetChatFilter : IChatFilter {
override val enabled: Boolean get() = config.hideAutopetMessages
override fun shouldFilter(message: String): Boolean = message.matches(PetAPI.AUTOPET_REGEX)
}