mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 09:05:04 +08:00
🎨 sort imports in file
This commit is contained in:
parent
02af1c1227
commit
5de41a18f9
@ -58,6 +58,7 @@ class WebSocket(BaseWebSocket):
|
||||
try:
|
||||
data = await self.receive()
|
||||
except websockets.ConnectionClosedOK:
|
||||
logger.debug(f'Websocket connection {self.websocket} closed')
|
||||
break
|
||||
except Exception as e:
|
||||
logger.exception(f'Websocket client listened {self.websocket} '
|
||||
|
@ -1,12 +1,14 @@
|
||||
import json
|
||||
from enum import Enum
|
||||
from typing import Dict, Any, Optional, Type
|
||||
from typing import Any, Dict, Optional, Type
|
||||
|
||||
from pydantic import BaseModel, Field, ValidationError
|
||||
from typing_extensions import Literal
|
||||
|
||||
from nonebot.adapters import Event as BaseEvent
|
||||
from nonebot.adapters import Message as BaseMessage
|
||||
from nonebot.typing import overrides
|
||||
from nonebot.log import logger
|
||||
from nonebot.typing import overrides
|
||||
|
||||
|
||||
class SenderPermission(str, Enum):
|
||||
@ -104,3 +106,6 @@ class Event(BaseEvent):
|
||||
@overrides(BaseEvent)
|
||||
def is_tome(self) -> bool:
|
||||
return False
|
||||
|
||||
def normalize_dict(self, **kwargs) -> Dict[str, Any]:
|
||||
return json.loads(self.json(**kwargs))
|
||||
|
@ -1,10 +1,11 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from pydantic import Field
|
||||
from .base import Event, SenderInfo, PrivateSenderInfo
|
||||
|
||||
from nonebot.typing import overrides
|
||||
|
||||
from ..message import MessageChain
|
||||
from nonebot.typing import overrides
|
||||
from .base import Event, PrivateSenderInfo, SenderInfo
|
||||
|
||||
|
||||
class MessageEvent(Event):
|
||||
|
@ -1,4 +1,4 @@
|
||||
from typing import Optional, Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from enum import Enum
|
||||
from typing import Any, Dict, List, Union, Iterable
|
||||
from typing import Any, Dict, Iterable, List, Union
|
||||
|
||||
from pydantic import validate_arguments
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user