WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit bbea005

Browse files
committed
增加插件 metadata
1 parent bf8c764 commit bbea005

File tree

11 files changed

+169
-147
lines changed

11 files changed

+169
-147
lines changed

haruka_bot/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from nonebot.plugin import PluginMetadata
12
from nonebot.plugin.manager import PluginLoader
23

34
if isinstance(globals()["__loader__"], PluginLoader):
@@ -8,3 +9,17 @@
89
from . import plugins # noqa: F401
910

1011
from .version import VERSION, __version__ # noqa: F401
12+
13+
__plugin_meta__ = PluginMetadata(
14+
name="haruka_bot",
15+
description="将B站UP主的动态和直播信息推送至QQ",
16+
usage="https://haruka-bot.sk415.icu/",
17+
homepage="https://github.com/SK-415/HarukaBot",
18+
type="application",
19+
supported_adapters={"~onebot.v11", "~qqguild"},
20+
extra={
21+
"author": "SK-415",
22+
"version": __version__,
23+
"priority": 1,
24+
},
25+
)

haruka_bot/cli/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def create_env():
2222
if any(Path.cwd().iterdir()):
2323
print("文件夹不为空,请更换空文件夹后重试")
2424
import sys
25+
2526
sys.exit()
2627

2728
while True:

haruka_bot/libs/dynamic/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from typing import Optional
22
from nonebot.adapters.onebot.v11.message import MessageSegment, Message
33
from pydantic import BaseModel, root_validator
4+
45
# from pydantic import Json
56

67
from .desc import Desc
8+
79
# from .card import Card
810
# from .display import Display
911

haruka_bot/libs/dynamic/card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ class Card(BaseModel):
5151

5252
apiSeasonInfo: Optional[APISeasonInfo]
5353

54-
new_desc: Optional[str]
54+
new_desc: Optional[str]

haruka_bot/libs/dynamic/desc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ class Desc(BaseModel):
2929
# dynamic_id_str: str
3030
# pre_dy_id_str: str
3131
# orig_dy_id_str: str
32-
# rid_str: str
32+
# rid_str: str

haruka_bot/libs/dynamic/display.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class EmojiDetail(BaseModel):
2121

2222
class EmojiInfo(BaseModel):
2323
"""emoji 信息"""
24+
2425
emoji_details: List[EmojiDetail]
2526

2627

haruka_bot/libs/dynamic/user_profile.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
class Info(BaseModel):
77
"""用户信息"""
8+
89
uid: Optional[int]
910
uname: Optional[str]
1011
face: Optional[str]
@@ -14,18 +15,21 @@ class Info(BaseModel):
1415

1516
class LevelInfo(BaseModel):
1617
"""等级信息"""
18+
1719
current_level: Optional[int]
1820

1921

2022
class Pendant(BaseModel):
2123
"""挂件"""
24+
2225
pid: int
2326
name: str
2427
image: str
2528

2629

2730
class OfficialVerify(BaseModel):
2831
"""账号认证信息"""
32+
2933
type: int
3034
desc: str
3135

@@ -36,6 +40,7 @@ class Card(BaseModel):
3640

3741
class VIP(BaseModel):
3842
"""大会员信息"""
43+
3944
vipType: int
4045
nickname_color: str
4146

@@ -45,4 +50,4 @@ class UserProfile(BaseModel):
4550
level_info: Optional[LevelInfo]
4651
pendant: Optional[Pendant]
4752
card: Optional[Card]
48-
vip: Optional[VIP]
53+
vip: Optional[VIP]

haruka_bot/utils/browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async def get_dynamic_screenshot_mobile(dynamic_id):
5858
try:
5959
await page.route(re.compile("^https://static.graiax/fonts/(.+)$"), fill_font)
6060
if plugin_config.haruka_captcha_address:
61-
page = await resolve_captcha(url,page)
61+
page = await resolve_captcha(url, page)
6262
else:
6363
await page.goto(
6464
url,

haruka_bot/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from packaging.version import Version
22

3-
__version__ = "1.6.0"
3+
__version__ = "1.6.0post1"
44
VERSION = Version(__version__)

pdm.lock

Lines changed: 134 additions & 133 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)