From 65ffe027e33637c4508588fcf1b4f32c3e121f29 Mon Sep 17 00:00:00 2001 From: SK-415 <2967923486@qq.com> Date: Mon, 6 Feb 2023 09:27:40 -0500 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=9D=20Update=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dafe6f05..4448ad08 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ HarukaBot 针对不同的推送场景(粉丝群、娱乐群、直播通知群 - [go-cqhttp](https://github.com/Mrs4s/go-cqhttp):稳定完善的 CQHTTP 实现。 - [bilibili-API-collect](https://github.com/SocialSisterYi/bilibili-API-collect):非常详细的 B 站 API 文档。 - [bilibili_api](https://github.com/Passkou/bilibili_api):Python 实现的 B 站 API 库。 -- [HarukaBot_Guild_Patch](https://github.com/17TheWord/HarukaBot_Guild_Patch) 可以让HarukaBot适用于频道的补丁。 +- [HarukaBot_Guild_Patch](https://github.com/17TheWord/HarukaBot_Guild_Patch) 可以让HarukaBot适用于频道的补丁。(已合入 HarukaBot) ## 支持与贡献 From c751c4e45427441950f7ab317e48d7f8b6d512e3 Mon Sep 17 00:00:00 2001 From: SK-415 <2967923486@qq.com> Date: Thu, 9 Feb 2023 08:08:16 -0500 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20Use=20specific=20name=20for?= =?UTF-8?q?=20tortoise-orm=20connection=20and=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- haruka_bot/database/db.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/haruka_bot/database/db.py b/haruka_bot/database/db.py index 3f300848..242f2d4d 100644 --- a/haruka_bot/database/db.py +++ b/haruka_bot/database/db.py @@ -22,12 +22,24 @@ class DB: @classmethod async def init(cls): """初始化数据库""" - from . import models # noqa: F401 + config = { + "connections": { + # "haruka_bot": { + # "engine": "tortoise.backends.sqlite", + # "credentials": {"file_path": get_path("data.sqlite3")}, + # }, + "haruka_bot": f"sqlite://{get_path('data.sqlite3')}" + }, + "apps": { + "haruka_bot_app": { + "models": ["haruka_bot.database.models"], + "default_connection": "haruka_bot", + } + }, + } + + await Tortoise.init(config) - await Tortoise.init( - db_url=f"sqlite://{get_path('data.sqlite3')}", - modules={"models": [locals()["models"]]}, - ) await Tortoise.generate_schemas() await cls.migrate() await cls.update_uid_list() From 12af8709f4ad4392cf244fa26c31edb6762c3239 Mon Sep 17 00:00:00 2001 From: SK-415 <2967923486@qq.com> Date: Thu, 9 Feb 2023 08:19:11 -0500 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=96=20Release=20v1.5.3.post1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1e82193c..beeed14a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "nonebot-plugin-guild-patch~=0.2", ] name = "haruka-bot" -version = "1.5.3" +version = "1.5.3.post1" description = "Push dynamics and live informations from bilibili to QQ. Based on nonebot2." readme = "README.md" keywords = ["nonebot", "nonebot2", "qqbot", "bilibili", "bot"]