Skip to content

Commit

Permalink
🏷️ 修复依赖更新后的类型错误 (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
A-kirami committed Sep 12, 2023
1 parent 05dba59 commit be2621e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kirami/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import nonebot
from nonebot.adapters import Adapter, Bot
from nonebot.drivers import Driver, ReverseDriver
from nonebot.drivers import ASGIMixin, Driver
from nonebot.plugin.manager import PluginManager, _managers
from nonebot.plugin.plugin import Plugin
from nonebot.utils import path_to_module_name
Expand Down Expand Up @@ -119,8 +119,8 @@ def get_app() -> Any:
ValueError: 全局 `nonebot.drivers.Driver` 对象尚未初始化(`kirami.KiramiBot` 尚未实例化)
"""
driver = get_driver()
if not isinstance(driver, ReverseDriver):
raise TypeError("app object is only available for reverse driver")
if not isinstance(driver, ASGIMixin):
raise TypeError("app object is only available for asgi driver")
return driver.server_app


Expand All @@ -133,8 +133,8 @@ def get_asgi() -> Any:
ValueError: 全局 `nonebot.drivers.Driver` 对象尚未初始化(`kirami.KiramiBot` 尚未实例化)
"""
driver = get_driver()
if not isinstance(driver, ReverseDriver):
raise TypeError("asgi object is only available for reverse driver")
if not isinstance(driver, ASGIMixin):
raise TypeError("asgi object is only available for asgi driver")
return driver.asgi


Expand Down

0 comments on commit be2621e

Please sign in to comment.