可以通过Bot判断是否为官bot

This commit is contained in:
HibiKier 2024-10-18 23:13:16 +08:00
parent 3d3a2a5f7f
commit c9aa568767

View File

@ -45,7 +45,7 @@ class UserData(BaseModel):
class PlatformUtils: class PlatformUtils:
@classmethod @classmethod
def is_qbot(cls, session: Uninfo) -> bool: def is_qbot(cls, session: Uninfo | Bot) -> bool:
"""判断bot是否为qq官bot """判断bot是否为qq官bot
参数: 参数:
@ -54,6 +54,8 @@ class PlatformUtils:
返回: 返回:
bool: 是否为官bot bool: 是否为官bot
""" """
if isinstance(session, Bot):
return bool(BotConfig.get_qbot_uid(session.self_id))
return session.scope == SupportScope.qq_api return session.scope == SupportScope.qq_api
@classmethod @classmethod