mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-27 18:45:05 +08:00
🐛 assert bot when disconnect (#1757)
This commit is contained in:
parent
be81d094b4
commit
f3aa8c6aa5
@ -66,8 +66,9 @@ class Adapter(abc.ABC):
|
|||||||
参数:
|
参数:
|
||||||
bot: {ref}`nonebot.adapters.Bot` 实例
|
bot: {ref}`nonebot.adapters.Bot` 实例
|
||||||
"""
|
"""
|
||||||
|
if self.bots.pop(bot.self_id, None) is None:
|
||||||
|
raise RuntimeError(f"{bot} not found in adapter {self.get_name()}")
|
||||||
self.driver._bot_disconnect(bot)
|
self.driver._bot_disconnect(bot)
|
||||||
self.bots.pop(bot.self_id, None)
|
|
||||||
|
|
||||||
def setup_http_server(self, setup: HTTPServerSetup):
|
def setup_http_server(self, setup: HTTPServerSetup):
|
||||||
"""设置一个 HTTP 服务器路由配置"""
|
"""设置一个 HTTP 服务器路由配置"""
|
||||||
|
Loading…
Reference in New Issue
Block a user