Commit fe8ed44e authored by Him188's avatar Him188

Fix At.followedBy

parent 39786150
...@@ -17,6 +17,8 @@ import net.mamoe.mirai.utils.MiraiInternalAPI ...@@ -17,6 +17,8 @@ import net.mamoe.mirai.utils.MiraiInternalAPI
/** /**
* At 一个人. 只能发送给一个群. * At 一个人. 只能发送给一个群.
*
* @see AtAll 全体成员
*/ */
class At @MiraiInternalAPI constructor(val target: Long, val display: String) : Message { class At @MiraiInternalAPI constructor(val target: Long, val display: String) : Message {
@UseExperimental(MiraiInternalAPI::class) @UseExperimental(MiraiInternalAPI::class)
...@@ -33,10 +35,10 @@ class At @MiraiInternalAPI constructor(val target: Long, val display: String) : ...@@ -33,10 +35,10 @@ class At @MiraiInternalAPI constructor(val target: Long, val display: String) :
// 自动为消息补充 " " // 自动为消息补充 " "
override fun followedBy(tail: Message): MessageChain { override fun followedBy(tail: Message): MessageChain {
if(tail is PlainText && !tail.stringValue.startsWith(' ')){ if(tail is PlainText && tail.stringValue.startsWith(' ')){
return super.followedBy(PlainText(" ")) + tail return super.followedBy(tail)
} }
return super.followedBy(tail) return super.followedBy(PlainText(" ")) + tail
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment