mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-29 11:40:28 +08:00
* ⬆️ `pre-commit-ci`自动升级 updates: - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) - [github.com/pycqa/flake8: 6.1.0 → 7.0.0](https://github.com/pycqa/flake8/compare/6.1.0...7.0.0) * 🚨 `pre-commit-ci`修复格式错误 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
25 lines
809 B
Python
25 lines
809 B
Python
from typing import List, Union, Literal, Optional
|
||
|
||
from msgspec import Struct
|
||
|
||
|
||
class Button(Struct):
|
||
text: str
|
||
data: str # 具体数据
|
||
pressed_text: Optional[str] = None # 按下之后显示的值
|
||
style: Literal[0, 1] = 1 # 0灰色线框,1蓝色线框
|
||
action: Literal[-1, 0, 1, 2] = (
|
||
-1
|
||
) # 0跳转按钮,1回调按钮,2命令按钮, 【-1自适应】
|
||
permisson: Literal[0, 1, 2, 3] = (
|
||
2 # 0指定用户,1管理者,2所有人可按,3指定身份组
|
||
)
|
||
specify_role_ids: List[str] = [] # 仅限频道可用
|
||
specify_user_ids: List[str] = [] # 指定用户
|
||
unsupport_tips: str = '您的客户端暂不支持该功能, 请升级后适配...'
|
||
|
||
|
||
ButtonType = Union[
|
||
List[str], List[Button], List[List[str]], List[List[Button]]
|
||
]
|