Skip to content

Commit

Permalink
♻️ move to nonebot mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Sep 23, 2023
1 parent 4cf2865 commit 94cb83f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions nonebot/adapters/feishu/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@
from pygtrie import StringTrie
from pydantic import parse_obj_as
from nonebot.utils import escape_tag
from nonebot.drivers import (
URL,
Driver,
Request,
Response,
ReverseDriver,
HTTPServerSetup,
)
from nonebot.drivers import URL, Driver, Request, Response, ASGIMixin, HTTPServerSetup

from nonebot.adapters import Adapter as BaseAdapter

Expand Down Expand Up @@ -54,11 +47,11 @@ def get_name(cls) -> str:
return "Feishu"

def setup(self) -> None:
if not isinstance(self.driver, ReverseDriver):
if not isinstance(self.driver, ASGIMixin):
raise RuntimeError(
f"Current driver {self.config.driver} "
"doesn't support reverse connections!"
"Feishu Adapter need a ReverseDriver to work."
"Feishu Adapter need a ASGIMixin to work."
)

@self.driver.on_startup
Expand Down Expand Up @@ -88,7 +81,7 @@ async def _():
log(
"ERROR",
"<r><bg #f8bbd0>Failed to get bot info.</bg #f8bbd0></r> "
f"Bot {bot_config.app_id} disconnected",
f"Skipped Bot {bot_config.app_id} registration",
)
continue

Expand Down

0 comments on commit 94cb83f

Please sign in to comment.