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
c0a9db0e
Commit
c0a9db0e
authored
Jan 19, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
a4d78b3d
57574f14
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
295 additions
and
77 deletions
+295
-77
UpdateLog.md
UpdateLog.md
+25
-0
gradle.properties
gradle.properties
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/MessageSubscribers.kt
...onMain/kotlin/net.mamoe.mirai/event/MessageSubscribers.kt
+265
-76
mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt
...rai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt
+4
-0
No files found.
UpdateLog.md
View file @
c0a9db0e
...
...
@@ -2,6 +2,31 @@
开发版本. 频繁更新, 不保证高稳定性
## `0.12.0` *2020/1/19*
### mirai-core
1.
监听消息时允许使用条件式的表达式, 如:
```
kotlin
(
contains
(
"1"
)
and
has
<
Image
>()){
reply
(
"Your message has a string '1' and an image contained"
)
}
(
contains
(
"1"
)
or
endsWith
(
"2"
)){
}
```
原有单一条件语法不变:
```
kotlin
contains
(
"1"
){
}
"Hello"
reply
"World"
```
2.
Message: 修复
`eq`
无法正确判断的问题; 性能优化.
3.
简化 logger 结构(API 不变).
4.
事件
`cancelled`
属性修改为
`val`
(以前是
`var`
with
`private set`
)
## `0.11.0` *2020/1/12*
### mirai-core
-
弃用
`BotAccount.id`
. 将来它可能会被改名成为邮箱等账号. QQ 号码需通过
`bot.uin`
获取.
...
...
gradle.properties
View file @
c0a9db0e
# style guide
kotlin.code.style
=
official
# config
mirai_version
=
0.1
1
.0
mirai_version
=
0.1
2
.0
kotlin.incremental.multiplatform
=
true
kotlin.parallel.tasks.in.project
=
true
# kotlin
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/MessageSubscribers.kt
View file @
c0a9db0e
This diff is collapsed.
Click to expand it.
mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt
View file @
c0a9db0e
...
...
@@ -138,6 +138,10 @@ suspend fun main() {
}.
reply
()
}
(
contains
(
"1"
)
and
has
<
Image
>()){
reply
(
"Your message has a string \"1\" and an image contained"
)
}
has
<
Image
>
{
if
(
this
is
FriendMessage
||
(
this
is
GroupMessage
&&
this
.
permission
==
MemberPermission
.
ADMINISTRATOR
))
withContext
(
IO
)
{
val
image
:
Image
by
message
...
...
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