This commit is contained in:
@ -1,20 +1,23 @@
|
||||
import asyncio
|
||||
from nonebot import get_driver
|
||||
from nonebot_plugin_alconna import UniMessage
|
||||
from konabot.plugins.poster.poster_info import register_poster_info, PosterInfo
|
||||
from konabot.plugins.poster.service import broadcast
|
||||
from konabot.common.subscribe import register_poster_info, PosterInfo, broadcast
|
||||
|
||||
|
||||
CHANNEL_STARTUP = "启动通知"
|
||||
|
||||
|
||||
register_poster_info(CHANNEL_STARTUP, PosterInfo(
|
||||
aliases=set(),
|
||||
description="当 Bot 重启时告知",
|
||||
))
|
||||
register_poster_info(
|
||||
CHANNEL_STARTUP,
|
||||
PosterInfo(
|
||||
aliases=set(),
|
||||
description="当 Bot 重启时告知",
|
||||
),
|
||||
)
|
||||
|
||||
driver = get_driver()
|
||||
|
||||
|
||||
@driver.on_startup
|
||||
async def _():
|
||||
# 要尽量保证接受讯息的服务存在
|
||||
@ -30,4 +33,3 @@ async def _():
|
||||
await broadcast(CHANNEL_STARTUP, UniMessage.text("此方 BOT 重启好了"))
|
||||
|
||||
asyncio.create_task(task())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user