nonebot2/website/versioned_docs/version-2.2.1/tutorial/fundamentals.md
noneflow[bot] d1601bf2fe 🔖 Release 2.2.1
2024-02-24 04:35:38 +00:00

25 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
sidebar_position: 1
description: NoneBot 机器人构成及基本使用
options:
menu:
- category: tutorial
weight: 30
---
# 机器人的构成
了解机器人的基本构成有助于你更好地使用 NoneBot本章节将介绍 NoneBot 中的基本组成部分,稍后的文档中将会使用到这些概念。
使用 NoneBot 框架搭建的机器人具有以下几个基本组成部分:
1. NoneBot 机器人框架主体:负责连接各个组成部分,提供基本的机器人功能
2. 驱动器 `Driver`:客户端/服务端的功能实现,负责接收和发送消息(通常为 HTTP 通信)
3. 适配器 `Adapter`:驱动器的上层,负责将**平台消息**与 NoneBot 事件/操作系统的消息格式相互转换
4. 插件 `Plugin`:机器人的功能实现,通常为负责处理事件并进行一系列的操作
除 NoneBot 机器人框架主体外,其他部分均可按需选择、互相搭配,但由于平台的兼容性问题,部分插件可能仅在某些特定平台上可用(这由插件编写者决定)。
在接下来的章节中,我们将重点介绍机器人功能实现,即插件 `Plugin` 部分。