mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-18 17:35:46 +08:00
15 lines
264 B
Python
15 lines
264 B
Python
import nonebot
|
|
from nonebot.adapters import Bot
|
|
|
|
driver = nonebot.get_driver()
|
|
|
|
|
|
@driver.on_bot_connect
|
|
async def connect(bot: Bot) -> None:
|
|
print("Connect", bot)
|
|
|
|
|
|
@driver.on_bot_disconnect
|
|
async def disconnect(bot: Bot) -> None:
|
|
print("Disconnect", bot)
|