兼容开放平台接口升级,UID改成Open ID

This commit is contained in:
John Smith
2024-03-17 22:11:19 +08:00
parent 1cbdd4a2bf
commit da3e27c8cb
10 changed files with 45 additions and 55 deletions

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = '0.0.1' # TODO UID改成open ID后再改成正式版
__version__ = '0.0.1' # TODO 上舰消息加上price后再改成正式版
from .handlers import *
from .client import *

View File

@@ -245,7 +245,7 @@ async def send_text(
content: str,
author_name: str = '',
*,
uid: int = 0,
uid: str = '',
avatar_url: str = '',
author_type: int = models.AuthorType.NORMAL.value,
guard_level: int = models.GuardLevel.NONE.value,
@@ -260,7 +260,7 @@ async def send_text(
:param content: 内容
:param author_name: 用户名默认为当前插件ID
:param uid: 用户ID
:param uid: 用户Open ID或ID
:param avatar_url: 用户头像URL默认自动生成
:param author_type: 用户类型见AuthorType
:param guard_level: 舰队等级见GuardLevel

View File

@@ -217,8 +217,8 @@ class AddTextMsg:
"""内容类型见ContentType"""
content_type_params: Union[dict, list] = dataclasses.field(default_factory=dict)
"""跟内容类型相关的参数"""
uid: int = 0
"""用户ID"""
uid: str = ''
"""用户Open ID或ID"""
medal_name: str = ''
"""勋章名"""
@@ -274,8 +274,8 @@ class AddGiftMsg:
"""礼物ID"""
gift_icon_url: str = ''
"""礼物图标URL"""
uid: int = 0
"""用户ID"""
uid: str = ''
"""用户Open ID或ID"""
privilege_type: int = GuardLevel.NONE.value
"""舰队等级见GuardLevel"""
medal_level: int = 0
@@ -321,8 +321,8 @@ class AddMemberMsg:
"""数量"""
unit: str = ''
"""单位(月)"""
uid: int = 0
"""用户ID"""
uid: str = ''
"""用户Open ID或ID"""
medal_level: int = 0
"""勋章等级如果没戴当前房间勋章则为0"""
medal_name: str = ''
@@ -362,8 +362,8 @@ class AddSuperChatMsg:
"""内容"""
translation: str = ''
"""内容翻译"""
uid: int = 0
"""用户ID"""
uid: str = ''
"""用户Open ID或ID"""
privilege_type: int = GuardLevel.NONE.value
"""舰队等级见GuardLevel"""
medal_level: int = 0