mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-30 14:36:41 +00:00 
			
		
		
		
	🚨 auto fix by pre-commit hooks
This commit is contained in:
		| @@ -66,18 +66,17 @@ options: | |||||||
|    连接之前必须要注册 `adapter` |    连接之前必须要注册 `adapter` | ||||||
|    ::: |    ::: | ||||||
|  |  | ||||||
|  |  | ||||||
| ### adapter 处理原始数据 | ### adapter 处理原始数据 | ||||||
|  |  | ||||||
| 1.  `adapter` 检查授权许可,并获取 `self-id` 作为唯一识别 id 。 | 1.  `adapter` 检查授权许可,并获取 `self-id` 作为唯一识别 id 。 | ||||||
|  |  | ||||||
|    ::: tip | ::: tip | ||||||
|    如果协议端通过 `websocket` 上报数据,这个步骤只会在建立连接时进行,并在之后运行 `on_bot_connect` 钩子函数;通过 `http` 方式连接时,会在协议端每次上报数据时都进行这个步骤。 | 如果协议端通过 `websocket` 上报数据,这个步骤只会在建立连接时进行,并在之后运行 `on_bot_connect` 钩子函数;通过 `http` 方式连接时,会在协议端每次上报数据时都进行这个步骤。 | ||||||
|    ::: | ::: | ||||||
|  |  | ||||||
|    ::: warning | ::: warning | ||||||
|    `self-id` 是帐号的唯一识别 ID,这意味着不能出现相同的 `self-id`。 | `self-id` 是帐号的唯一识别 ID,这意味着不能出现相同的 `self-id`。 | ||||||
|    ::: | ::: | ||||||
|  |  | ||||||
| 2. 根据 `self-id` 实例化 `adapter` 相应的 `bot` 。 | 2. 根据 `self-id` 实例化 `adapter` 相应的 `bot` 。 | ||||||
|  |  | ||||||
| @@ -204,6 +203,4 @@ options: | |||||||
|  |  | ||||||
| 一般来说,我们可以用 `bot.*` 来调用 `API` (\*是 `API` 的 `action` 或者 `endpoint`)。 | 一般来说,我们可以用 `bot.*` 来调用 `API` (\*是 `API` 的 `action` 或者 `endpoint`)。 | ||||||
|  |  | ||||||
|  |  | ||||||
| 对于发送消息而言,一方面可以调用既有的 `API` ;另一方面 `nonebot` 实现了两个便捷方法,`bot.send(event, message, **kwargs)` 方法和可以在 `handler` 中使用的 `Matcher.send(message, **kwargs)` 方法,来向事件主体发送消息。 | 对于发送消息而言,一方面可以调用既有的 `API` ;另一方面 `nonebot` 实现了两个便捷方法,`bot.send(event, message, **kwargs)` 方法和可以在 `handler` 中使用的 `Matcher.send(message, **kwargs)` 方法,来向事件主体发送消息。 | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user