mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 08:11:38 +00:00
add contextvars and fix mutable default args
This commit is contained in:
@ -42,6 +42,10 @@ class BaseBot(abc.ABC):
|
||||
async def call_api(self, api: str, data: dict):
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
async def send(self, *args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
# TODO: improve event
|
||||
class BaseEvent(abc.ABC):
|
||||
@ -102,6 +106,16 @@ class BaseEvent(abc.ABC):
|
||||
def user_id(self, value) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def group_id(self) -> Optional[int]:
|
||||
raise NotImplementedError
|
||||
|
||||
@group_id.setter
|
||||
@abc.abstractmethod
|
||||
def group_id(self, value) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def to_me(self) -> Optional[bool]:
|
||||
|
Reference in New Issue
Block a user