mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-10 06:10:01 +08:00
✨ 可以通过Bot判断是否为官bot
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user