Files
nonebot-plugin-tetris-stats/nonebot_plugin_tetris_stats/games/tetrio/constant.py
pre-commit-ci[bot] a116f9901c ⬆️ auto update by pre-commit hooks (#520)
* ⬆️ auto update by pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.3 → v0.8.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.3...v0.8.1)

* 🚨 auto fix by pre-commit hooks

* 🚨 fix ruff

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: shoucandanghehe <wallfjjd@gmail.com>
2024-12-03 20:23:19 +08:00

38 lines
602 B
Python

from re import compile # noqa: A004
from typing import Literal
from yarl import URL
from .api.typing import ValidRank
GAME_TYPE: Literal['IO'] = 'IO'
BASE_URL = URL('https://ch.tetr.io/api/')
RANK_PERCENTILE: dict[ValidRank, float] = {
'x+': 0.2,
'x': 1,
'u': 5,
'ss': 11,
's+': 17,
's': 23,
's-': 30,
'a+': 38,
'a': 46,
'a-': 54,
'b+': 62,
'b': 70,
'b-': 78,
'c+': 84,
'c': 90,
'c-': 95,
'd+': 97.5,
'd': 100,
}
TR_MIN = 0
TR_MAX = 25000
USER_ID = compile(r'^[a-f0-9]{24}$')
USER_NAME = compile(r'^[a-zA-Z0-9_-]{3,16}$')