🐛 修复一些BUG

This commit is contained in:
KimigaiiWuyi 2023-10-08 23:33:34 +08:00
parent 45c1778b36
commit d00a569c59
4 changed files with 5 additions and 5 deletions

View File

@ -142,7 +142,7 @@ class Bot:
_options: List[str] = []
for option in option_list:
if isinstance(option, Button):
_options.append(option.text)
_options.append(option.data)
else:
_options.append(option)

View File

@ -48,7 +48,7 @@ class GsClient:
user_type='direct',
user_pm=1,
group_id=None,
user_id='444836641',
user_id='511',
content=content,
)
msg_send = msgjson.encode(msg)

View File

@ -71,7 +71,7 @@ async def msg_process(msg: MessageReceive) -> Event:
async def handle_event(ws: _Bot, msg: MessageReceive):
# 获取用户权限,越小越高
user_pm = await get_user_pml(msg)
msg.user_pm = user_pm = await get_user_pml(msg)
event = await msg_process(msg)
logger.info('[收到事件]', event=event)

View File

@ -5,8 +5,8 @@ from msgspec import Struct
class Button(Struct):
text: str
data: Optional[str] # 具体数据
pressed_text: Optional[str] # 按下之后显示的值
data: str # 具体数据
pressed_text: Optional[str] = None # 按下之后显示的值
style: Literal[0, 1] = 1 # 0灰色线框1蓝色线框
action: Literal[0, 1, 2] = 2 # 0跳转按钮1回调按钮2命令按钮
permisson: Literal[0, 1, 2, 3] = 2 # 0指定用户1管理者2所有人可按3指定身份组