Skip to content

Commit efdf9da

Browse files
authored
Merge pull request #329 from SK-415/dev
Release v1.5.3.post1
2 parents 8c4fb62 + 12af870 commit efdf9da

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ HarukaBot 针对不同的推送场景(粉丝群、娱乐群、直播通知群
3737
- [go-cqhttp](https://github.com/Mrs4s/go-cqhttp):稳定完善的 CQHTTP 实现。
3838
- [bilibili-API-collect](https://github.com/SocialSisterYi/bilibili-API-collect):非常详细的 B 站 API 文档。
3939
- [bilibili_api](https://github.com/Passkou/bilibili_api):Python 实现的 B 站 API 库。
40-
- [HarukaBot_Guild_Patch](https://github.com/17TheWord/HarukaBot_Guild_Patch) 可以让HarukaBot适用于频道的补丁。
40+
- [HarukaBot_Guild_Patch](https://github.com/17TheWord/HarukaBot_Guild_Patch) 可以让HarukaBot适用于频道的补丁。(已合入 HarukaBot)
4141

4242
## 支持与贡献
4343

haruka_bot/database/db.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,24 @@ class DB:
2222
@classmethod
2323
async def init(cls):
2424
"""初始化数据库"""
25-
from . import models # noqa: F401
25+
config = {
26+
"connections": {
27+
# "haruka_bot": {
28+
# "engine": "tortoise.backends.sqlite",
29+
# "credentials": {"file_path": get_path("data.sqlite3")},
30+
# },
31+
"haruka_bot": f"sqlite://{get_path('data.sqlite3')}"
32+
},
33+
"apps": {
34+
"haruka_bot_app": {
35+
"models": ["haruka_bot.database.models"],
36+
"default_connection": "haruka_bot",
37+
}
38+
},
39+
}
40+
41+
await Tortoise.init(config)
2642

27-
await Tortoise.init(
28-
db_url=f"sqlite://{get_path('data.sqlite3')}",
29-
modules={"models": [locals()["models"]]},
30-
)
3143
await Tortoise.generate_schemas()
3244
await cls.migrate()
3345
await cls.update_uid_list()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies = [
2121
"nonebot-plugin-guild-patch~=0.2",
2222
]
2323
name = "haruka-bot"
24-
version = "1.5.3"
24+
version = "1.5.3.post1"
2525
description = "Push dynamics and live informations from bilibili to QQ. Based on nonebot2."
2626
readme = "README.md"
2727
keywords = ["nonebot", "nonebot2", "qqbot", "bilibili", "bot"]

0 commit comments

Comments
 (0)