Ruff 检查

This commit is contained in:
ManyManyTomato 2025-07-05 08:32:08 +00:00
parent 6d322b0f13
commit 53b8a5397b
15 changed files with 15 additions and 15 deletions

View File

@ -251,7 +251,7 @@ class PluginManage:
)
group.status = False
await group.save(update_fields=["status"])
@classmethod
async def wake(cls, group_id: str):
"""醒来

View File

@ -280,4 +280,4 @@ async def _(bot: Bot, session: Uninfo):
else:
await MessageUtils.build_message("你在做梦吗?你没有昵称啊").finish(
reply_to=True
)
)

View File

@ -31,4 +31,4 @@ async def _(session: Uninfo):
await FriendUser.create(
user_id=session.user.id, platform=PlatformUtils.get_platform(session)
)
logger.info("添加当前好友用户信息", "", session=session)
logger.info("添加当前好友用户信息", "", session=session)

View File

@ -48,4 +48,4 @@ __plugin_meta__ = PluginMetadata(
plugin_type=PluginType.SUPERUSER,
is_show=False,
).to_dict(),
)
)

View File

@ -833,4 +833,4 @@ async def _(schedule_id: int):
f"▫️ 触发规则: {_format_trigger(status)}",
f"▫️ 任务参数: {_format_params(status)}",
]
await schedule_cmd.finish("\n".join(info_lines))
await schedule_cmd.finish("\n".join(info_lines))

View File

@ -29,7 +29,7 @@ class BotConsole(Model):
class Meta: # pyright: ignore [reportIncompatibleVariableOverride]
table = "bot_console"
table_description = "Bot数据表"
cache_type = CacheType.BOT
@staticmethod

View File

@ -58,7 +58,7 @@ class PluginInfo(Model):
class Meta: # pyright: ignore [reportIncompatibleVariableOverride]
table = "plugin_info"
table_description = "插件基本信息"
cache_type = CacheType.PLUGINS
@classmethod

View File

@ -35,4 +35,4 @@ class ScheduleInfo(Model):
class Meta: # pyright: ignore [reportIncompatibleVariableOverride]
table = "schedule_info"
table_description = "通用定时任务表"
table_description = "通用定时任务表"

View File

@ -42,7 +42,7 @@ class Model(TortoiseModel):
Model_: Model
"""
sem_data: ClassVar[dict[str, dict[str, Semaphore]]] = {}
def __init_subclass__(cls, **kwargs):
if cls.__module__ not in MODELS:
MODELS.append(cls.__module__)

View File

@ -91,4 +91,4 @@ class AsyncPlaywright:
if card:
await card.screenshot(path=path, timeout=timeout, type=type_)
return MessageUtils.build_message(path)
return None
return None

View File

@ -223,4 +223,4 @@ class Retry:
return sync_wrapper
return decorator
return decorator

View File

@ -50,7 +50,7 @@ class CacheType(StrEnum):
"""用户权限"""
LIMIT = "GLOBAL_LIMIT"
"""插件限制"""
class BankHandleType(StrEnum):
DEPOSIT = "DEPOSIT"
"""存款"""

View File

@ -83,4 +83,4 @@ class AllURIsFailedError(Exception):
f" - {url}: {exc.__class__.__name__}({exc})"
for url, exc in zip(self.urls, self.exceptions)
)
return f"All {len(self.urls)} URIs failed:\n{exc_info}"
return f"All {len(self.urls)} URIs failed:\n{exc_info}"

View File

@ -691,4 +691,4 @@ class AsyncHttpx:
httpx.AsyncClient: 一个配置好的临时的客户端实例
"""
async with get_async_client(**kwargs) as client:
yield client
yield client

View File

@ -807,4 +807,4 @@ async def _load_schedules_from_db():
count += 1
else:
logger.warning(f"跳过加载定时任务:插件 '{schedule.plugin_name}' 未注册。")
logger.info(f"定时任务加载完成,共成功加载 {count} 个任务。")
logger.info(f"定时任务加载完成,共成功加载 {count} 个任务。")