Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
2f1df3b2
Commit
2f1df3b2
authored
Nov 08, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fit new api
parent
7771856a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
mirai-demos/mirai-demo-1/src/main/java/demo/subscribe/SubscribeSamples.kt
...i-demo-1/src/main/java/demo/subscribe/SubscribeSamples.kt
+5
-5
No files found.
mirai-demos/mirai-demo-1/src/main/java/demo/subscribe/SubscribeSamples.kt
View file @
2f1df3b2
...
...
@@ -92,13 +92,13 @@ suspend fun Bot.messageDSL() {
// 在回复的时候, 一般使用 subject 来作为回复对象.
// 因为当群消息时, subject 为这个群.
// 当好友消息时, subject 为这个好友.
// 所有在
SenderAndMessage
(也就是此时的 this 指代的对象) 中实现的扩展方法, 如刚刚的 "reply", 都是以 subject 作为目标
// 所有在
MessagePacket
(也就是此时的 this 指代的对象) 中实现的扩展方法, 如刚刚的 "reply", 都是以 subject 作为目标
}
// 当消息里面包含这个类型的消息时
has
<
Image
>
{
// this:
SenderAndMessage
// this:
MessagePacket
// message: MessageChain
// sender: QQ
// it: String (MessageChain.toString)
...
...
@@ -161,7 +161,7 @@ suspend fun Bot.messageDSL() {
subscribeMessages
{
case
(
"你好"
)
{
// this:
SenderAndMessage
// this:
MessagePacket
// message: MessageChain
// sender: QQ
// it: String (来自 MessageChain.toString)
...
...
@@ -172,7 +172,7 @@ suspend fun Bot.messageDSL() {
subscribeFriendMessages
{
contains
(
"A"
)
{
// this: Friend
SenderAnd
Message
// this: FriendMessage
// message: MessageChain
// sender: QQ
// it: String (来自 MessageChain.toString)
...
...
@@ -181,7 +181,7 @@ suspend fun Bot.messageDSL() {
}
subscribeGroupMessages
{
// this: Friend
SenderAnd
Message
// this: FriendMessage
// message: MessageChain
// sender: QQ
// it: String (来自 MessageChain.toString)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment