mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 17:15:05 +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)
|