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
f7379d8b
Commit
f7379d8b
authored
Jan 31, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo
parent
b939f703
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/MessageSubscribers.kt
...onMain/kotlin/net.mamoe.mirai/event/MessageSubscribers.kt
+2
-2
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/MessageSubscribers.kt
View file @
f7379d8b
...
@@ -518,7 +518,7 @@ class MessageSubscribersBuilder<T : MessagePacket<*, *>>(
...
@@ -518,7 +518,7 @@ class MessageSubscribersBuilder<T : MessagePacket<*, *>>(
* [replier] 的 `it` 将会是去掉用来判断的后缀并删除前后空格后的字符串.
* [replier] 的 `it` 将会是去掉用来判断的后缀并删除前后空格后的字符串.
* 如当消息为 " 123456 test" 时
* 如当消息为 " 123456 test" 时
* ```kotlin
* ```kotlin
* "test" ends
w
ithReply {
* "test" ends
W
ithReply {
* println(it) // it 为 "123456"
* println(it) // it 为 "123456"
* }
* }
* ```
* ```
...
@@ -526,7 +526,7 @@ class MessageSubscribersBuilder<T : MessagePacket<*, *>>(
...
@@ -526,7 +526,7 @@ class MessageSubscribersBuilder<T : MessagePacket<*, *>>(
* @param replier 若返回 [Message] 则直接发送; 若返回 [Unit] 则不回复; 其他情况则 [Any.toString] 后回复
* @param replier 若返回 [Message] 则直接发送; 若返回 [Unit] 则不回复; 其他情况则 [Any.toString] 后回复
*/
*/
@MessageDsl
@MessageDsl
inline
infix
fun
String
.
ends
w
ithReply
(
crossinline
replier
:
@MessageDsl
suspend
T
.(
String
)
->
Any
?):
Listener
<
T
>
{
inline
infix
fun
String
.
ends
W
ithReply
(
crossinline
replier
:
@MessageDsl
suspend
T
.(
String
)
->
Any
?):
Listener
<
T
>
{
val
toCheck
=
this
.
trimEnd
()
val
toCheck
=
this
.
trimEnd
()
return
content
({
it
.
trim
().
endsWith
(
toCheck
)
},
{
return
content
({
it
.
trim
().
endsWith
(
toCheck
)
},
{
@Suppress
(
"DSL_SCOPE_VIOLATION_WARNING"
)
@Suppress
(
"DSL_SCOPE_VIOLATION_WARNING"
)
...
...
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