mirror of https://github.com/Mai-with-u/MaiBot.git
增加platform判断自身支持
parent
b63b7a7fb9
commit
e5c6ff1365
|
|
@ -108,7 +108,9 @@ def is_bot_self(platform: str, user_id: str) -> bool:
|
|||
# 其他平台:尝试从 platforms 配置中查找
|
||||
platform_account = platform_accounts.get(platform, "")
|
||||
if platform_account:
|
||||
return user_id_str == platform_account
|
||||
if user_id_str == platform_account:
|
||||
return True
|
||||
return user_id_str == qq_account
|
||||
|
||||
# 默认情况:与主 QQ 账号比较(兼容性)
|
||||
return user_id_str == qq_account
|
||||
|
|
|
|||
|
|
@ -273,7 +273,9 @@ class Person:
|
|||
# 其他平台:尝试从 platforms 配置中查找
|
||||
platform_account = platform_accounts.get(platform, "")
|
||||
if platform_account:
|
||||
return user_id_str == platform_account
|
||||
if user_id_str == platform_account:
|
||||
return True
|
||||
return user_id_str == qq_account
|
||||
|
||||
# 默认情况:与主 QQ 账号比较(兼容性)
|
||||
return user_id_str == qq_account
|
||||
|
|
|
|||
Loading…
Reference in New Issue