mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-10 22:30:02 +08:00
🐛 修复超级用户id获取问题
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import random
|
||||
from pathlib import Path
|
||||
|
||||
import nonebot
|
||||
@@ -8,7 +7,6 @@ from .utils import ConfigsManager
|
||||
|
||||
|
||||
class BotSetting(BaseModel):
|
||||
|
||||
self_nickname: str = ""
|
||||
"""回复时NICKNAME"""
|
||||
system_proxy: str | None = None
|
||||
@@ -18,19 +16,18 @@ class BotSetting(BaseModel):
|
||||
platform_superusers: dict[str, list[str]] = {}
|
||||
"""平台超级用户"""
|
||||
|
||||
def get_superuser(self, platform: str) -> str:
|
||||
def get_superuser(self, platform: str) -> list[str]:
|
||||
"""获取超级用户
|
||||
|
||||
参数:
|
||||
platform: 对应平台
|
||||
|
||||
返回:
|
||||
str | None: 超级用户id
|
||||
list[str]: 超级用户id
|
||||
"""
|
||||
if self.platform_superusers:
|
||||
if platform_superuser := self.platform_superusers.get(platform):
|
||||
return random.choice(platform_superuser)
|
||||
return ""
|
||||
return self.platform_superusers.get(platform, [])
|
||||
return []
|
||||
|
||||
def get_sql_type(self) -> str:
|
||||
"""获取数据库类型
|
||||
|
||||
Reference in New Issue
Block a user