✏️ add typing

This commit is contained in:
yanyongyu
2021-12-21 18:22:14 +08:00
parent b900133ab4
commit 9b2fa46921
8 changed files with 35 additions and 29 deletions

View File

@ -168,6 +168,8 @@ class Driver(abc.ABC):
def _bot_connect(self, bot: "Bot") -> None:
"""在 WebSocket 连接成功后,调用该函数来注册 bot 对象"""
if bot.self_id in self._clients:
raise RuntimeError(f"Duplicate bot connection with id {bot.self_id}")
self._clients[bot.self_id] = bot
async def _run_hook(bot: "Bot") -> None: