Skip to content

Commit

Permalink
feat: 适配插件元数据
Browse files Browse the repository at this point in the history
  • Loading branch information
NekoAria committed Jul 15, 2022
1 parent bd8771f commit 480356c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/plugins/ELF_RSS2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import asyncio

import arrow
import nonebot
from nonebot import on_metaevent, require
from nonebot.adapters.onebot.v11 import Event, LifecycleMetaEvent
from nonebot.adapters.onebot.v11 import Bot, Event, LifecycleMetaEvent
from nonebot.log import logger
from nonebot.plugin import PluginMetadata

from . import command
from . import my_trigger as tr
from .config import DATA_PATH, config
from .rss_class import Rss

VERSION = "2.6.4"
__plugin_meta__ = PluginMetadata(
name="ELF_RSS",
description="QQ机器人 RSS订阅 插件,订阅源建议选择 RSSHub",
usage="https://github.com/Quan666/ELF_RSS",
extra={"author": "Quan666 <[email protected]>", "version": VERSION},
)

scheduler = require("nonebot_plugin_apscheduler").scheduler
START_TIME = arrow.now()

Expand All @@ -26,17 +34,14 @@ async def check_first_connect(event: Event) -> bool:

# 启动时发送启动成功信息
@start_metaevent.handle()
async def start() -> None:
bot = nonebot.get_bot()
async def start(bot: Bot) -> None:

# 启动后检查 data 目录,不存在就创建
if not DATA_PATH.is_dir():
DATA_PATH.mkdir()

boot_message = (
f"Version: {config.version}\n"
"Author:Quan666\n"
"https://github.com/Quan666/ELF_RSS"
f"Version: v{VERSION}\nAuthor:Quan666\nhttps://github.com/Quan666/ELF_RSS"
)

rss_list = Rss.read_rss() # 读取list
Expand Down

0 comments on commit 480356c

Please sign in to comment.