mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-06 17:10:48 +08:00
Fix At.followedBy
This commit is contained in:
parent
397861500f
commit
fe8ed44ef2
@ -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) :
|
|||||||
// 自动为消息补充 " "
|
// 自动为消息补充 " "
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user