Skip to content

Commit

Permalink
♻️ remove deprecated overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Aug 6, 2023
1 parent 2eb0209 commit bc2657b
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 107 deletions.
8 changes: 4 additions & 4 deletions nonebot/adapters/onebot/v11/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import asyncio
import inspect
import contextlib
from typing_extensions import override
from typing import Any, Dict, List, Type, Union, Callable, Optional, Generator, cast

from nonebot.typing import overrides
from nonebot.exception import WebSocketClosed
from nonebot.utils import DataclassEncoder, escape_tag
from nonebot.drivers import (
Expand Down Expand Up @@ -61,7 +61,7 @@ class Adapter(BaseAdapter):

_result_store = ResultStore()

@overrides(BaseAdapter)
@override
def __init__(self, driver: Driver, **kwargs: Any):
super().__init__(driver, **kwargs)
self.onebot_config: Config = Config(**self.config.dict())
Expand All @@ -71,7 +71,7 @@ def __init__(self, driver: Driver, **kwargs: Any):
self._setup()

@classmethod
@overrides(BaseAdapter)
@override
def get_name(cls) -> str:
"""适配器名称: `OneBot V11`"""
return "OneBot V11"
Expand Down Expand Up @@ -126,7 +126,7 @@ def _setup(self) -> None:
self.driver.on_startup(self._start_forward)
self.driver.on_shutdown(self._stop_forward)

@overrides(BaseAdapter)
@override
async def _call_api(self, bot: Bot, api: str, **data: Any) -> Any:
websocket = self.connections.get(bot.self_id, None)
timeout: float = data.get("_timeout", self.config.api_timeout)
Expand Down
4 changes: 2 additions & 2 deletions nonebot/adapters/onebot/v11/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"""

import re
from typing_extensions import override
from typing import Any, Union, Callable

from nonebot.typing import overrides
from nonebot.message import handle_event

from nonebot.adapters import Bot as BaseBot
Expand Down Expand Up @@ -193,7 +193,7 @@ async def handle_event(self, event: Event) -> None:

await handle_event(self, event)

@overrides(BaseBot)
@override
async def send(
self,
event: Event,
Expand Down
Loading

0 comments on commit bc2657b

Please sign in to comment.