mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
change typing
This commit is contained in:
@ -5,14 +5,16 @@ import abc
|
||||
from ipaddress import IPv4Address
|
||||
|
||||
from nonebot.config import Config
|
||||
from nonebot.typing import Optional
|
||||
from nonebot.adapters import BaseBot
|
||||
from nonebot.typing import Dict, Optional
|
||||
|
||||
|
||||
class BaseDriver(abc.ABC):
|
||||
|
||||
@abc.abstractmethod
|
||||
def __init__(self, config: Config):
|
||||
raise NotImplementedError
|
||||
self.config = config
|
||||
self._clients: Dict[int, BaseBot] = {}
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
@ -29,6 +31,10 @@ class BaseDriver(abc.ABC):
|
||||
def logger(self):
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def bots(self) -> Dict[int, BaseBot]:
|
||||
return self._clients
|
||||
|
||||
@abc.abstractmethod
|
||||
def run(self,
|
||||
host: Optional[IPv4Address] = None,
|
||||
|
Reference in New Issue
Block a user