mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-05 03:39:59 +08:00
🚨 Add specific ignore items in pyright ignore
🚨 Make pyright happy ♻️ Remove unused adapter
This commit is contained in:
@@ -206,6 +206,8 @@ class Manager:
|
||||
返回:
|
||||
list: 消息内容
|
||||
"""
|
||||
if not session.group:
|
||||
return None
|
||||
json_data = cls.__get_data(session)
|
||||
if not json_data:
|
||||
return None
|
||||
|
||||
@@ -23,7 +23,7 @@ ARM_KEY = "aarch64"
|
||||
|
||||
@dataclass
|
||||
class CPUInfo:
|
||||
core: int
|
||||
core: int | None
|
||||
"""CPU 物理核心数"""
|
||||
usage: float
|
||||
"""CPU 占用百分比,取值范围(0,100]"""
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from typing import ClassVar
|
||||
|
||||
from nonebot.adapters import Bot, Event
|
||||
from nonebot.adapters.onebot.v11 import PokeNotifyEvent
|
||||
from nonebot.exception import IgnoredException
|
||||
@@ -38,11 +40,11 @@ class Limit(BaseModel):
|
||||
|
||||
|
||||
class LimitManage:
|
||||
add_module = [] # noqa: RUF012
|
||||
add_module: ClassVar[list] = []
|
||||
|
||||
cd_limit: dict[str, Limit] = {} # noqa: RUF012
|
||||
block_limit: dict[str, Limit] = {} # noqa: RUF012
|
||||
count_limit: dict[str, Limit] = {} # noqa: RUF012
|
||||
cd_limit: ClassVar[dict[str, Limit]] = {}
|
||||
block_limit: ClassVar[dict[str, Limit]] = {}
|
||||
count_limit: ClassVar[dict[str, Limit]] = {}
|
||||
|
||||
@classmethod
|
||||
def add_limit(cls, limit: PluginLimit):
|
||||
|
||||
@@ -16,7 +16,9 @@ except ImportError:
|
||||
|
||||
|
||||
try:
|
||||
from nonebot.adapters.qq import Bot # noqa: F401
|
||||
from nonebot.adapters.qq import ( # noqa: F401 # pyright: ignore [reportMissingImports]
|
||||
Bot,
|
||||
)
|
||||
|
||||
nonebot.load_plugins(str((path / "qq_api").resolve()))
|
||||
except ImportError:
|
||||
|
||||
@@ -17,7 +17,7 @@ class SqlLog(Model):
|
||||
create_time = fields.DatetimeField(auto_now_add=True)
|
||||
"""创建时间"""
|
||||
|
||||
class Meta: # type: ignore
|
||||
class Meta: # pyright: ignore [reportIncompatibleVariableOverride]
|
||||
table = "sql_log"
|
||||
table_description = "sql执行日志"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user