feat(chat): support BanchoBot

This commit is contained in:
MingxuanGame
2025-08-16 10:31:46 +00:00
parent 3de73f2420
commit e1d42743d3
11 changed files with 302 additions and 23 deletions

View File

@@ -88,6 +88,16 @@ class GameMode(str, Enum):
}[self]
return self
@classmethod
def parse(cls, v: str | int) -> "GameMode | None":
if isinstance(v, int) or v.isdigit():
return cls.from_int_extra(int(v))
v = v.lower()
try:
return cls[v]
except ValueError:
return None
class Rank(str, Enum):
X = "X"