mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 08:50:15 +08:00
Update docs
This commit is contained in:
parent
9a0c79705e
commit
ed81ac4351
11
docs/Messages.md
Normal file
11
docs/Messages.md
Normal file
@ -0,0 +1,11 @@
|
||||
# Mirai - Messages
|
||||
|
||||
## 消息系统
|
||||
|
||||
在 Contacts 章节提到,要发送消息,使用 `Contact.sendMessage(Message)`。
|
||||
|
||||
[![](https://mermaid.ink/img/eyJjb2RlIjoiY2xhc3NEaWFncmFtXG5cbmNsYXNzIE1lc3NhZ2VDaGFpblxuTWVzc2FnZUNoYWluIDogTGlzdH5TaW5nbGVNZXNzYWdlflxuXG5NZXNzYWdlPHwtLU1lc3NhZ2VDaGFpblxuTWVzc2FnZTx8LS1TaW5nbGVNZXNzYWdlXG5cbk1lc3NhZ2VDaGFpbiBvLS0gU2luZ2xlTWVzc2FnZVxuXG5TaW5nbGVNZXNzYWdlPHwtLU1lc3NhZ2VDb250ZW50XG5TaW5nbGVNZXNzYWdlPHwtLU1lc3NhZ2VNZXRhZGF0YVxuXG4iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ)](https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiY2xhc3NEaWFncmFtXG5cbmNsYXNzIE1lc3NhZ2VDaGFpblxuTWVzc2FnZUNoYWluIDogTGlzdH5TaW5nbGVNZXNzYWdlflxuXG5NZXNzYWdlPHwtLU1lc3NhZ2VDaGFpblxuTWVzc2FnZTx8LS1TaW5nbGVNZXNzYWdlXG5cbk1lc3NhZ2VDaGFpbiBvLS0gU2luZ2xlTWVzc2FnZVxuXG5TaW5nbGVNZXNzYWdlPHwtLU1lc3NhZ2VDb250ZW50XG5TaW5nbGVNZXNzYWdlPHwtLU1lc3NhZ2VNZXRhZGF0YVxuXG4iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ)
|
||||
|
||||
`SingleMessage` 表示单个消息元素,`MessageChain`(消息链) 是 `List<SingleMessage>`。主动发送的消息和从服务器接收消息都是 `MessageChain`。
|
||||
|
||||
mirai 提供大量消息链的扩展:[MessageChain.kt](../mirai-core-api/src/commonMain/kotlin/message/data/MessageChain.kt#L59)。
|
@ -57,18 +57,18 @@ class Member {
|
||||
+group: Group
|
||||
}
|
||||
|
||||
ContactOrBot<--Contact
|
||||
ContactOrBot<--UserOrBot
|
||||
ContactOrBot<|--Contact
|
||||
ContactOrBot<|--UserOrBot
|
||||
|
||||
UserOrBot<--Bot
|
||||
UserOrBot<--User
|
||||
UserOrBot<|--Bot
|
||||
UserOrBot<|--User
|
||||
|
||||
Contact<--User
|
||||
Contact<--Group
|
||||
Contact<|--User
|
||||
Contact<|--Group
|
||||
|
||||
User<--Member
|
||||
User<--Friend
|
||||
User<|--Member
|
||||
User<|--Friend
|
||||
|
||||
Member<--NormalMember
|
||||
Member<--AnonymousMember
|
||||
Member<|--NormalMember
|
||||
Member<|--AnonymousMember
|
||||
```
|
47
docs/src/Messages.mermaid.md
Normal file
47
docs/src/Messages.mermaid.md
Normal file
@ -0,0 +1,47 @@
|
||||
```mermaid
|
||||
classDiagram
|
||||
|
||||
class MessageChain
|
||||
MessageChain : List~SingleMessage~
|
||||
|
||||
Message<|--MessageChain
|
||||
Message<|--SingleMessage
|
||||
|
||||
MessageChain o-- SingleMessage
|
||||
|
||||
SingleMessage<|--MessageContent
|
||||
SingleMessage<|--MessageMetadata
|
||||
|
||||
|
||||
%%%
|
||||
|
||||
|
||||
MessageMetadata<|--QuoteReply
|
||||
MessageMetadata<|--MessageSource
|
||||
|
||||
|
||||
%%
|
||||
|
||||
MessageSource<|--OnlineMessageSource
|
||||
MessageSource<|--OfflineMessageSource
|
||||
|
||||
MessageContent<|--PlainText
|
||||
MessageContent<|--Image
|
||||
MessageContent<|--At
|
||||
MessageContent<|--AtAll
|
||||
MessageContent<|--Face
|
||||
MessageContent<|--ForwardMessage
|
||||
|
||||
MessageContent<|--HummerMessage
|
||||
HummerMessage<|--PokeMessage
|
||||
HummerMessage<|--VipFace
|
||||
HummerMessage<|--FlashImage
|
||||
|
||||
MessageContent<|--RichMessage
|
||||
RichMessage<|--ServiceMessage
|
||||
RichMessage<|--LightApp
|
||||
|
||||
|
||||
MessageContent<|--PttMessage
|
||||
PttMessage<|--Voice
|
||||
```
|
Loading…
Reference in New Issue
Block a user