✨ Compatible with pydantic 2.0 using the pydantic compatibility layer provided by nonebot

This commit is contained in:
HibiKier
2025-01-10 12:19:11 +08:00
committed by BalconyJH
parent 23ef00d01f
commit e814469b75
69 changed files with 178 additions and 147 deletions
@@ -32,7 +32,7 @@ __plugin_meta__ = PluginMetadata(
author="",
version="0.1",
plugin_type=PluginType.SUPERUSER,
).dict(),
).to_dict(),
)
from .bot_switch import * # noqa: F403
@@ -38,7 +38,7 @@ __plugin_meta__ = PluginMetadata(
)
],
tasks=[Task(module="broadcast", name="广播")],
).dict(),
).to_dict(),
)
_matcher = on_command("广播", priority=1, permission=SUPERUSER, block=True)
@@ -26,7 +26,7 @@ __plugin_meta__ = PluginMetadata(
author="HibiKier",
version="0.1",
plugin_type=PluginType.SUPERUSER,
).dict(),
).to_dict(),
)
@@ -25,7 +25,7 @@ __plugin_meta__ = PluginMetadata(
author="HibiKier",
version="0.1",
plugin_type=PluginType.SUPERUSER,
).dict(),
).to_dict(),
)
_matcher = on_command(
@@ -1,5 +1,4 @@
from nonebot.adapters import Bot
from nonebot.adapters.kaiheila.exception import ApiNotAvailable
from nonebot.permission import SUPERUSER
from nonebot.plugin import PluginMetadata
from nonebot.rule import to_me
@@ -22,7 +21,7 @@ __plugin_meta__ = PluginMetadata(
author="HibiKier",
version="0.1",
plugin_type=PluginType.SUPERUSER,
).dict(),
).to_dict(),
)
_friend_matcher = on_alconna(
@@ -71,8 +70,6 @@ async def _(
msg = f"| UID | 昵称 | 共{len(fl)}个好友\n" + msg
await MessageUtils.build_message(msg).send()
logger.info("查看好友列表", "好友列表", session=session)
except (ApiNotAvailable, AttributeError):
await MessageUtils.build_message("Api未实现...").send()
except Exception as e:
logger.error("好友列表发生错误", "好友列表", session=session, e=e)
await MessageUtils.build_message("其他未知错误...").send()
@@ -91,8 +88,6 @@ async def _(
msg = f"| GID | 名称 | 共{len(gl)}个群组\n" + msg
await MessageUtils.build_message(msg).send()
logger.info("查看群组列表", "群组列表", session=session)
except (ApiNotAvailable, AttributeError):
await MessageUtils.build_message("Api未实现...").send()
except Exception as e:
logger.error("查看群组列表发生错误", "群组列表", session=session, e=e)
await MessageUtils.build_message("其他未知错误...").send()
@@ -53,7 +53,7 @@ __plugin_meta__ = PluginMetadata(
author="HibiKier",
version="0.1",
plugin_type=PluginType.SUPERUSER,
).dict(),
).to_dict(),
)
@@ -37,7 +37,7 @@ __plugin_meta__ = PluginMetadata(
type=int,
),
],
).dict(),
).to_dict(),
)
_matcher = on_alconna(
@@ -46,7 +46,7 @@ __plugin_meta__ = PluginMetadata(
author="HibiKier",
version="0.1",
plugin_type=PluginType.SUPERUSER,
).dict(),
).to_dict(),
)
@@ -36,7 +36,7 @@ __plugin_meta__ = PluginMetadata(
author="HibiKier",
version="0.1",
plugin_type=PluginType.SUPERUSER,
).dict(),
).to_dict(),
)
@@ -32,7 +32,7 @@ __plugin_meta__ = PluginMetadata(
default_value="zhenxun",
)
],
).dict(),
).to_dict(),
)
_matcher = on_alconna(
@@ -22,7 +22,7 @@ __plugin_meta__ = PluginMetadata(
author="HibiKier",
version="0.1",
plugin_type=PluginType.SUPERUSER,
).dict(),
).to_dict(),
)