Initial implementation of custom price triggers

- likely to have some bugs, but this is good enough for a preview release.
This commit is contained in:
2025-11-06 02:46:03 -08:00
parent 19eb0a4e24
commit ed79f4b65c
8 changed files with 197 additions and 58 deletions

View File

@@ -99,7 +99,8 @@ class Alert:
def to_human_string(self):
if self.alert_type == AlertType.SPECIFIC_PRICE:
raise NotImplementedError
price_gold = self.price
return f"Custom Price: {format(price_gold, ',')}g"
else:
alert_type_str = " ".join(self.alert_type.name.split("_"))
return f"{alert_type_str.title()}"

View File

@@ -38,4 +38,7 @@ class AlertType(Enum):
case "All Time Low":
return AlertType.ALL_TIME_LOW
case _:
# Check if it's a custom price format like "Custom Price: 250,000g"
if category.startswith("Custom Price"):
return AlertType.SPECIFIC_PRICE
return AlertType.SPECIFIC_PRICE