wow-token-app-bot/token_bot/persistant_database/alert_category.py
Emily Doherty 34badf17eb Once and for all reformat.
Will be using black code formatter
2024-12-08 17:07:26 -08:00

22 lines
558 B
Python

from enum import Enum
class AlertCategory(Enum):
HIGH = 1
LOW = 2
CUSTOM = 3
@staticmethod
def from_str(
category: str,
): # It gets mad when I use the Type[AlertCategory] as a type hint
match category:
case "high_alert_button":
return AlertCategory.HIGH
case "low_alert_button":
return AlertCategory.LOW
case "sp_add_button":
return AlertCategory.CUSTOM
case _:
return AlertCategory[category.upper()]