gsuid_core/gsuid_core/message_models.py
pre-commit-ci[bot] 1172d9c939
⬆️ pre-commit-ci自动升级 (#47)
* ⬆️ `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>
2024-02-09 21:57:48 +08:00

25 lines
809 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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]]
]