mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 04:06:28 +08:00
💥 drop self_id call_api support
This commit is contained in:
parent
c82a4820f7
commit
918b375ece
@ -152,7 +152,6 @@ class Bot(abc.ABC):
|
|||||||
:参数:
|
:参数:
|
||||||
|
|
||||||
* ``api: str``: API 名称
|
* ``api: str``: API 名称
|
||||||
* ``self_id: Optional[str]``: 指定调用 API 的机器人
|
|
||||||
* ``**data``: API 数据
|
* ``**data``: API 数据
|
||||||
|
|
||||||
:示例:
|
:示例:
|
||||||
@ -176,11 +175,7 @@ class Bot(abc.ABC):
|
|||||||
result = None
|
result = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if "self_id" in data and data["self_id"]:
|
result = await self._call_api(api, **data)
|
||||||
bot = self.driver.bots[str(data["self_id"])]
|
|
||||||
result = await bot._call_api(api, **data)
|
|
||||||
else:
|
|
||||||
result = await self._call_api(api, **data)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
exception = e
|
exception = e
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ sidebar: auto
|
|||||||
- 修复日志输出模块名错误
|
- 修复日志输出模块名错误
|
||||||
- 修改 `Matcher` 属性 `module` 类型
|
- 修改 `Matcher` 属性 `module` 类型
|
||||||
- 新增 `Matcher` 属性 `plugin_name` `module_name` `module_prefix`
|
- 新增 `Matcher` 属性 `plugin_name` `module_name` `module_prefix`
|
||||||
|
- 移除 `bot.call_api` 参数 `self_id` 切换机器人支持
|
||||||
|
|
||||||
## v2.0.0a13.post1
|
## v2.0.0a13.post1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user