wow-token-app-bot

An interactions.py Discord bot for getting and alerting on the WoW Token Price
git clone https://git.emily.sh/wowtoken-app/wow-token-app-bot.git
Log | Files | Refs | README | LICENSE

alert_category.py (558B)


      1 from enum import Enum
      2 
      3 
      4 class AlertCategory(Enum):
      5     HIGH = 1
      6     LOW = 2
      7     CUSTOM = 3
      8 
      9     @staticmethod
     10     def from_str(
     11         category: str,
     12     ):  # It gets mad when I use the Type[AlertCategory] as a type hint
     13         match category:
     14             case "high_alert_button":
     15                 return AlertCategory.HIGH
     16             case "low_alert_button":
     17                 return AlertCategory.LOW
     18             case "sp_add_button":
     19                 return AlertCategory.CUSTOM
     20             case _:
     21                 return AlertCategory[category.upper()]