mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-12 06:55:49 +08:00
🐛 修复一些BUG
This commit is contained in:
parent
45c1778b36
commit
d00a569c59
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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指定身份组
|
||||
|
Loading…
x
Reference in New Issue
Block a user